Halog not able to parse logfile

Don’t use -q when you troubleshoot this, because it will hide the summary which you need to know:

1 lines in, 0 lines out, 1 parsing errors

halog expects additional garbage in front of the log by default. If your log looks like you this, you need to add -s -4:

lukas@dev:~/haproxy/contrib/halog$ echo ' 91.1.2.3:52057 [17/Feb/2021:03:09:01.597] EXT_WEB~ be/srv2:443 0/0/0/11/11 401 1737 - - --NI 469/346/156/268009/0 0/0 "GET / HTTP/1.1"' | \
> ./halog -H -u
#req err ttot tavg oktot okavg bavg btot src
1 lines in, 0 lines out, 1 parsing errors
lukas@dev:~/haproxy/contrib/halog$
lukas@dev:~/haproxy/contrib/halog$
lukas@dev:~/haproxy/contrib/halog$ echo ' 91.1.2.3:52057 [17/Feb/2021:03:09:01.597] EXT_WEB~ be/srv2:443 0/0/0/11/11 401 1737 - - --NI 469/346/156/268009/0 0/0 "GET / HTTP/1.1"' | \
> ./halog -s -4 -H -u
#req err ttot tavg oktot okavg bavg btot src
1 0 11 11 11 11 1737 1737 /
1 lines in, 1 lines out, 0 parsing errors
lukas@dev:~/haproxy/contrib/halog$
lukas@dev:~/haproxy/contrib/halog$

I’m not claiming this is documented, let alone self-explanatory …

1 Like