goaccess icon indicating copy to clipboard operation
goaccess copied to clipboard

Cutom log format error

Open howdydevops opened this issue 4 years ago • 3 comments

Hello,

I am getting following error.

root@stag-vultr:~# goaccess -f /var/log/nginx/energy.staging90.com.access.log -a

GoAccess - version 0.8.5 - Sep 17 2021 04:01:53

Fatal error has occurred Error occured at: goaccess.c - main - 832 Nothing valid to process.

Sample log: [21/Sep/2021:18:39:46 +1000] 108.61.185.105 0.424 - energy.staging90.com "GET / HTTP/2.0" 503 3929 0.423 "https://energy.staging90.com/" "WordPress/5.8.1; https://energy.staging90.com"

Could you please advise me with the correct log format.

Thank you!

howdydevops avatar Sep 21 '21 11:09 howdydevops

This should work. Also, please make sure to update your goaccess to the latest version since 0.8.5 is pretty behind.

goaccess access.log --log-format='[%d:%t %^] %h %T %^ %v "%r" %s %b %^ "%R" "%u"' --date-format=%d/%b/%Y --time-format=%T

Feel free to use the official deb repo if running debian/ubuntu.

allinurl avatar Sep 22 '21 12:09 allinurl

Could you help me with my log as well?

217.230.242.0.0 - - [28/Sep/2021:00:00:03 +0200] "GET /datascience/stats HTTP/2.0" 200 436 "https://domain/datascience" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36 OPR/79.0.4143.50" "-"
goaccess aggregated.log --log-format=COMBINED
Parsed 1 linesproducing the following errors:

Token '217.230.242.0.0' doesn't match specifier '%h'

Format Errors - Verify your log/date/time format

I think goaccess has problems with anonymized ip addresses, where the 2 last octetts are replaced by zeros. Any workaround?

massih10 avatar Sep 29 '21 07:09 massih10

Hi @massih10

Please, try the suggestion made for allinurl. It is seems OK and work in my tests. However, if You have some problem, maybe you can try set LANG, i.e. export LANG en_US.UTF-8, and try run again.

0bi-w6n-K3nobi avatar Oct 13 '21 19:10 0bi-w6n-K3nobi