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
17.78k stars 1.09k forks source link

Nginx log format not working in Goaccess #2676

Closed init-sdrb closed 2 months ago

init-sdrb commented 2 months ago
          This is my nginx access.log format:

[28/Apr/2024:10:19:40 +0545] "125043" "source_ip" "GET /api/someApi/hello-limit-forr/load-mode HTTP/1.1" 200 145 "https://mysite.com.org/sub/member/search/go-search/111555" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36" "IPADDR" "Dest_ip:7671" "mysite.com.org" "0.002" "0.001"

I've tried a lot of options but still I am getting "Format Errors - Verify your log/date/time format"

Can somebody help me on this?

Originally posted by @init-sdrb in https://github.com/allinurl/goaccess/issues/1066#issuecomment-2088786610

allinurl commented 2 months ago

This should do it. Just ensure that the IP with %h is the one you are trying to match.

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

Thanks @allinurl , it worked like a charm. Also, is it possible to create our own custom dashboard or combine two different sections (e.g. Total number of unique IPs visited a particular site or api). Sorry if this question shouldn't be posted in this thread but just wanted to clear my thoughts on the goaccess customization.

allinurl commented 2 months ago

Glad that worked!

117 will tackle that issue. Keep an eye out as I'm actively working on it.