首页 > Github > 正文

apache access日志统计做图


Version: 1.0.0
OS: Linux
Author: justbio

apache-log-to-graph
用途
——-
把apache的access日志做成统计图

暂时只支持默认格式的日志
LogFormat:”%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"” combined

需求

Base

  • Python3.x

需要安装

matplotlib

pip3 install matplotlib

numpy

pip3 install numpy

Basemap

参考 basemaptutorial

需求文件

geoip2.database

in source\GeoLite2-db

shapefile

in source\shapefile

用法

解压到任意路径 编辑conf文件

vim conf/config.ini

logpath=apache_log_path_need_to_analyze
graphpath=path_to_save_graph

如果留空 ,默认为:

logpath=/var/log/httpd/
graphpath=./pngs/

执行

python3 mk_graph.py

Example


原创文章,转载请注明出处!
本文链接:https://justbio.github.io//posts/log-to-graph.html
上篇: matplotlib笔记
下篇: 更新微信报警,邮件报警脚本