8000 Log format parsing failure and confusing error message · Issue #2852 · allinurl/goaccess · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Log format parsing failure and confusing error message #2852
Open
@Majora320

Description

@Majora320

I have an nginx server using a slightly modified variant of its default log format. The specification in my nginx.conf is as follows:

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

and here are a couple of sample lines:

<ip address redacted> 185.218.84.178 - - [08/Jun/2025:00:46:38 +0000] "GET / HTTP/1.1" 444 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36 Edg/90.0.818.46" "-"
<domain name redacted> 18.215.249.66 - - [08/Jun/2025:00:53:32 +0000] "GET / HTTP/2.0" 401 581 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36" "-"

I am attempting to run the following goaccess command. The line it's attempting to parse is the first example above.

$ head -1 access.log | goaccess --log-format='%v %h - %e [%x] "%r" %s %b "%R" "%u" "~h"' --datetime-format='%d/%b/%Y:%H:%M:%S %z'
==43111== GoAccess - version 1.9.4 - Apr  1 2025 00:00:00
==43111== Config file: /etc/goaccess/goaccess.conf
==43111== https://goaccess.io - <hello@goaccess.io>
==43111== Released under the MIT License.
==43111==
==43111== FILE: -
==43111== Parsed 1 lines producing the following errors:
==43111==
==43111== Token '08/Jun/2025:00:46:38 +0000' doesn't match specifier '%x'
==43111==
==43111== Format Errors - Verify your log/date/time format

What's extremely confusing here is that even if I specify the exact text of the log line's datetime field as the datetime format, like so, I still get the same error.

$ head -1 access.log | goaccess --log-format='%v %h - %e [%x] "%r" %s %b "%R" "%u" "~h"' --datetime-format='08/Jun/2025:00:46:38 +0000'
Cleaning up resources...
==43126== GoAccess - version 1.9.4 - Apr  1 2025 00:00:00
==43126== Config file: /etc/goaccess/goaccess.conf
==43126== https://goaccess.io - <hello@goaccess.io>
==43126== Released under the MIT License.
==43126==
==43126== FILE: -
==43126== Parsed 1 lines producing the following errors:
==43126==
==43126== Token '08/Jun/2025:00:46:38 +0000' doesn't match specifier '%x'
==43126==
==43126== Format Errors - Verify your log/date/time format

Maybe my error is somewhere else in the format spec, but if so then GoAccess should tell me that.

I am using GoAccess 1.9.4 on CentOS.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0