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.5k stars 1.11k forks source link

%h and hostname vs ip #1742

Closed jhb2 closed 4 years ago

jhb2 commented 4 years ago

Hello,

I'm trying to parse my webserver log, using : goaccess /var/log/httpd/cooking-ez.com_access_log -o go.html --log-format=COMBINED

It's fine if the log line start with an IP address, but I got : Token '107.177.88.116.starhub.net.sg' doesn't match specifier '%h'

If it's an hostname at the beginning instead of an IP, like

107.177.88.116.starhub.net.sg - - [19/Apr/2020:03:42:26 +0200] "GET /images/recettes/viandes/206-6.jpg HTTP/1.1" 200 18773 "https://cooking-ez.com/viandes/recette-pate-campagne.php" "Mozilla/5.0 (iPhone; CPU iPhone OS 13_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/80.0.3987.95 Mobile/15E148 Safari/604.1"

Is there a way to accept hostname AND ip address in log format ? Any idea of what's wrong there?

allinurl commented 4 years ago

Great question, this is a dup from #1552 unfortunately not at the moment, however, as a workaround, you could try building from development and pass --no-ip-validation.

allinurl commented 4 years ago

--no-ip-validation was added in v1.4.