我想用采空区解析和分析nginx日志,并从分析的日志中获取报告。但是,当我运行zcat -f access.log.*.gz | goaccess -a -c
命令时,它会给出以下错误:
GoAccess - version 0.5 - Jun 26 2012 04:30:08
An error has occurred
Error occured at: parser.c - process_log - 584
Message: No date format was found on your conf file.
我试图将行date_format %D %T
添加到.goaccessrc文件中,但发现了另一个错误,即:
GoAccess - version 0.5 - Jun 26 2012 04:30:08
An error has occurred
Error occured at: parser.c - process_log - 588
Message: No log format was found on your conf file.
我认为它要求使用nginx使用的日期和日志格式。但是我的nginx配置中没有任何日期或日志格式。
此外,我尝试使用先前版本的goaccess(0.4.2版本),zcat -f access.log.*.gz | goaccess -a -c
命令可以正常工作。它不要求任何日期或日志格式,我可以查看goaccess菜单,我可以查看任何想要的数据。
但是,当我尝试使用zcat -f access.log.*.gz | goaccess -a -c > report.html
命令获取html报告时,它什么也不做。它只是等待和等待。(没有任何警告或错误)
注意:我检查过这个网页,如果你也想看的话。
发布于 2013-05-19 12:24:24
使它与以下~/.goaccessrc
一起工作
date_format %d/%b/%Y:%T %z
log_format %h - - [%d] "%r" %s %b "%R" "%u"
我将GoAccess作为一个二进制包安装在wheezy存储库中(没有重新编译源代码)。
发布于 2012-09-23 20:48:57
假设您使用的是CLF格式字符串,我将使用-c
运行-c
,然后从配置菜单中选择NCSA Combined Log Format
。
将nginx中的"$time_local"
替换为"23/Aug/2010:03:50:59 +0000"
,因此应该将date_format %d/%b/%Y
添加到您的~/..goaccessrc中。
更新1
从源安装v0.5
Download
the 最新版本tar -xzvf goaccess-0.5.tar.gz
cd goaccess-0.5/
./configure --enable-utf8
make
sudo make install
goaccess -a -c /var/log/apache2/access.log
注意:如果您已经安装了它,那么在使用zcat
之前可能只需要执行步骤7发布于 2014-05-23 10:23:53
如果不想使用全局选项,请使用带有goaccess的--no-global-config
选项。我每天都在使用它来处理日志文件:
grep --color=auto `date +"%d/%b"` /var/log/nginx/sitename.access.log | goaccess --no-global-config > report.html
goaccess版本: 0.8
https://stackoverflow.com/questions/12525001
复制相似问题