I want to parse and analyze the nginx logs with goaccess and take a report from the analyzed logs.
But, when I run the zcat -f access.log.*.gz | goaccess -a -c
command, it gives me the following error :
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.
I tried to add the line date_format %D %T
to .goaccessrc file but I got another error which is:
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.
I think it asks for the date and log formats that nginx uses. but I have no any date or log format in my nginx configuration.
Additionally, I've tried to use a previous version of goaccess(0.4.2 version)
and the zcat -f access.log.*.gz | goaccess -a -c
command works fine.
it doesn't asks for any date or log format and i can view the goaccess menu and
i can view any data that want.
But when I try to get a html report with zcat -f access.log.*.gz | goaccess -a -c > report.html
command, it does nothing. it just waits and waits.(without giving any warning or error)
Note: i've checked this webpages and if you want to take a look too.
Got it working with the following ~/.goaccessrc
:
date_format %d/%b/%Y:%T %z
log_format %h - - [%d] "%r" %s %b "%R" "%u"
I installed GoAccess as a binary package from wheezy repository (no source recompilation).
Assuming you are using the CLF format string, I would run goaccess
with -c
and then choose NCSA Combined Log Format
from the config menu.
"$time_local"
in nginx is replaced with "23/Aug/2010:03:50:59 +0000"
so adding date_format %d/%b/%Y
to your ~/.goaccessrc should do it.
Update 1:
Installing v0.5 from source
Download
the latest version
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
Note: If you have it installed already, then you may only need to do step 7 prior to using zcat
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With