allinurl / goaccess

GoAccess is a real-time web log analyzer and interactive viewer that runs in a terminal in *nix systems or through your browser.
https://goaccess.io
MIT License
18.53k stars 1.11k forks source link

Log format error #2713

Open obayit opened 2 months ago

obayit commented 2 months ago

I am getting this error:

Token '.253.161.20' doesn't match specifier '%h'

Here is a sample line:

3.253.161.20 - - [31/Aug/2024:00:08:58 +0000] "GET /web/login?306 HTTP/1.1" 408 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36" "-" "4.981" "-" "-" "-"

Here is my config file:

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

goaccess version:

GoAccess - 1.5.5.
For more details visit: https://goaccess.io/
Copyright (C) 2009-2022 by Gerardo Orellana

Build configure arguments:
  --enable-utf8
  --enable-geoip=mmdb
  --with-openssl
allinurl commented 2 months ago

This should do it:

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

If you're specifying the format in the config file, use it without quotes, for example:

log-format %h %^[%d:%t %^] "%r" %s %b "%R" "%u" %^ "%T" %^
date-format %d/%b/%Y
time-format %T