Goaccess

安装

1
2
3
4
5
6
$ wget https://tar.goaccess.io/goaccess-1.3.tar.gz
$ tar -xzvf goaccess-1.3.tar.gz
$ cd goaccess-1.3/
$ ./configure --enable-utf8 --enable-geoip=mmdb
$ make
# make install

goaccess.conf

1
2
3
time-format %T
date-format %d/%b/%Y
log_format %h - %^ [%d:%t %^] "%r" %s %b "%R" "%u" "%^" %^ %^ %^ %T

log format

1
2
3
4
5
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" '
'$connection $upstream_addr '
'$upstream_response_time $request_time';
1
goaccess -p /etc/goaccess.conf -f /home/yzfcw.log -a --real-os --geoip-database=/tmp/geo.mmdb -o /usr/local/nginx15/html/status.html
坚持原创技术分享,您的支持将鼓励我继续创作!