Goaccess parsing not working

I am trying to work with goaccess. They have been dealing with documents and examples for a long time, but without success.

I basically have log lines, for example:

10031488_71334 xpto.domain.com 88.103.999.999 - - [16/Jun/2013:15:03:26 +0000] "GET / HTTP/1.1" 500 5624 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0" - 

and already compile goaccess and create the conf file:

 cat ~/.goaccessrc date_format %d/%b/%Y:%T %z log_format %^ %^ %h - - [$d] "%r" %s %b "%R" "%u" %^ 

Then I got:

 ./goaccess -a -f miniout.log GoAccess - version 0.6 - Aug 5 2013 20:20:16 An error has occurred Error occured at: goaccess.c - render_screens - 358 Message: Nothing valid to process. 

Any help? Thanks.

+4
source share
3 answers

If you do not want to use global options, use the --no-global-config option with goaccess. I use this to process log files every day:

 grep --color=auto `date +"%d/%b"` /var/log/nginx/sitename.access.log | goaccess --no-global-config > report.html 

version for goaccess: 0.8

+2
source

Solved by changing the log format:

 log_format %^ %^ %h %^[%d:%^] "%r" %s %b "%R" "%u" date_format %d/%b/%Y 
+1
source

First, view the log configuration in httpd.conf or in the site configuration files for vhost.

then follow the following logic.

Combined apache log log form:

% v% h% l% u% t \ "% r \"%> s% b \ "% {Referer} I \" \ "% {User-Agent} i \

to goaccess:

apache - what is it? - like in goaccess

% v - vhost -% ^ ignore it

% h - host -% h

% l - hyphen -% ^ ignore it

% u - user -% ^ ignore him

% t - timestamp - [% d: t %% ^] ignore zone from apache log

% r - request -% r

% s - status -% s

% b - size -% b

% {referer} I - request header -% R

% {UAgent} I - User Agent -% u

goaccess.conf

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

  • Note that in% r,% R and% u you will need a "" because these are text fields (I think)

  • Note that there is no space between% u and date (I don't know why ...)

from:

time format% H:% M:% S

date format% d /% b /% Y

Link:

https://httpd.apache.org/docs/2.2/logs.html

http://goaccess.io/man

+1
source

Source: https://habr.com/ru/post/1495390/


All Articles