goaccess日志分析

1.安装依赖
yum install -y ncurses-devel openssl-devel tokyocabinet-devel libmaxminddb-devel 
2.配置脚本
wget http://tar.goaccess.io/goaccess-1.2.tar.gz
tar -xzvf goaccess-1.2.tar.gz
cd goaccess-1.2/
./configure --prefix=/usr/local/goaccess \
--enable-utf8 \
--enable-geoip=mmdb \
--enable-tcb \
--with-openssl
make && make install
4.修改配置文件 /usr/local/goaccess/etc

time-format %H:%M:%S

date-format %d/%b/%Y

log-format %h %[1] "%r" %s %b "%R" "%u"

5.web界面

需要地理位置功能,可以先去下个geoip数据包 https://dev.maxmind.com/geoip/geoip2/geolite2/

./goaccess /data/tengine/logs/access.log \
--geoip-database=/usr/local/goaccess/geoip/GeoLite2-City.mmdb \
-o /data/goaccess/html/index.html \
--real-time-html --daemonize

nginx配置静态页面,默认使用80端口

location /report.html {
    alias html/report/index.html;
}
6.参考链接

https://www.jianshu.com/p/b134995ae16c

https://www.goaccess.cc/?mod=man

https://www.cnblogs.com/longren/p/10945623.html


  1. %d:%t %^ ↩︎

posted @ 2020-08-11 00:41  kylingx  阅读(129)  评论(0编辑  收藏  举报