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.26k stars 1.1k forks source link

Token doesn't match specifier '%h' for nginx format #2641

Closed zengzjie closed 5 months ago

zengzjie commented 6 months ago

log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$request_time $request_length ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent"';

access.log: 10.192.133.81 - - [12/Mar/2024:09:44:22 +0800] "GET /report HTTP/1.1" 0.000 471 404 555 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36"

Looking forward to receiving your reply,Thanks

allinurl commented 6 months ago

Sorry for the delay. This should work:

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

Let me know how it goes.

zengzjie commented 6 months ago

抱歉耽搁了。这应该有效:

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

让我知道事情的后续。

I will try it later,Thank you for your reply

allinurl commented 5 months ago

Closing this. Feel free to reopen it if needed.