码迷,mamicode.com
首页 > 数据库 > 详细

goaccess备忘

时间:2017-10-13 12:49:25      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:goaccess

安装支持组件yum install geoip-devel


$ wget http://tar.goaccess.io/goaccess-1.2.tar.gz

$ tar -xzvf goaccess-1.2.tar.gz

$ cd goaccess-1.2/

$ ./configure --enable-utf8 --enable-geoip=legacy

$ make

# make install

goaccess.conf后增加日志格式

time-format %T

date-format %d/%b/%Y

log-format %h %^[%d:%t %^] "%r" %s %b "%R" "%u"


To generate an HTML report, just run it against your web log file: (-a is optional)

# goaccess /var/log/apache2/access.log -a -o report.html

OR

# zcat -f /var/log/apache2/access.log* | goaccess -a -o report.html


Just generate a static report and place the output html file under your web server www public folder. You need to add a couple of additional real-time flags. The use of --real-time-html is required.

# goaccess access.log -o /usr/share/nginx/www/rt.goaccess.io/report.html --real-time-html

Upon opening the generated report in your browser, the report will try to establish a WebSocket connection to the host name (window.location.hostname) where the generated report is running from.


Also, it is worth pointing out that if we want to run GoAccess at lower priority, we can run it as:

# nice -n 19 goaccess access.log -a

and if you don‘t want to install it on your server, you can still run it from your local machine:

# ssh  root@192.168.9.213 ‘zcat /data/wwwlogs/nginx.log-2017*‘ | goaccess -a -o /data/wwwroot/Goaccess/report2017.html


goaccess备忘

标签:goaccess

原文地址:http://28917.blog.51cto.com/18917/1971999

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!