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

Need help with custom Nginx proxy log format #2082

Closed steffenweb closed 3 years ago

steffenweb commented 3 years ago

Hello, i want to use Goaccess with the log file of Nginx Proxy Manager. ( https://github.com/jc21/nginx-proxy-manager ) the log is:

[08/Apr/2021:12:45:59 +0000] 444 - GET https xxx.xxx.xxx.xxx "/" [Client xxx.xxx.xxx.xxx] [Length 0] [Gzip -] "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36" "-"
[08/Apr/2021:12:56:25 +0000] 200 - GET http xxx.xxx.xxx.xxx "/" [Client xxx.xxx.xxx.xxx] [Length 1033] [Gzip -] "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36" "-"

I tried to create to find the right log-format but somehow i didn't succeed.

log-format [%d:%t %^] %s %^ %m %^ %v "%U" [%^ %h] [%^ %b] [%^] "%u" %^
time-format %H:%M:%S
date-format %d/%b/%Y

Can someone help me with this please?

allinurl commented 3 years ago

Please try:

goaccess access.log --log-format='[%d:%t %^] %s %^ %m %^ %h "%U" %^] [Length %b] %^"%u" "%R"' --date-format=%d/%b/%Y --time-format=%T
steffenweb commented 3 years ago

It works! Thank you. This is a great Project!

timdonovanuk commented 3 years ago

Did nginx proxy manager change the format? This no longer works.

==1== Token '-' doesn't match specifier '%s'
==1== Token '-' doesn't match specifier '%s'
==1== Token '-' doesn't match specifier '%s'

etc.

Over the log:

[31/Aug/2021:14:27:46 +0000] - 304 304 - GET https my.domain.com "/public/css/vdi.css" [Client 111.111.111.11] [Length 0] [Gzip -] [Sent-to docker.home] "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36" "https://my.domain.com:8080/?login=true"

allinurl commented 3 years ago

@timdonovanuk what format are you using?