goaccess 使用手册

nginx日志分析利器
安装

1
apt-get install goaccess

修改配置文件

1
2
3
4
5
vim /etc/goaccess.conf
#以下三行注释取消
time-format %H:%M:%S
date-format %d/%b/%Y
log-format %h %^[%d:%t %^] "%r" %s %b

否则导出报表会得到如下提示

1
2
3
4
5
6
7
Parsing... [0] [0/s]
GoAccess - version 1.2 - Jun 19 2017 12:55:29
Config file: /etc/goaccess.conf

Fatal error has occurred
Error occured at: src/parser.c - parse_log - 2705
No time format was found on your conf file.

使用方法

1
goaccess -f logfile.log -a > report.html