Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest caddy and goaccess, not able to parse access logs #2387

Closed
rogierlommers opened this issue Sep 30, 2022 · 3 comments
Closed

Latest caddy and goaccess, not able to parse access logs #2387

rogierlommers opened this issue Sep 30, 2022 · 3 comments

Comments

@rogierlommers
Copy link

Please see the logging example below. It's normal caddy logs, in json structured format.

Versions

  • caddy version v2.6.1
  • Goaccess version GoAccess - 1.5.5

When I try to parse the logs, then I get this:

goaccess example.log --log-format=CADDY

Cleaning up resources...
==604754== GoAccess - Copyright (C) 2009-2020 by Gerardo Orellana
==604754== https://goaccess.io - <hello@goaccess.io>
==604754== Released under the MIT License.
==604754==
==604754== FILE: dsmr-access.log
==604754== Parsed 2 lines producing the following errors:
==604754==
==604754== IPv4/6 is required.
==604754== IPv4/6 is required.
==604754==
==604754== Format Errors - Verify your log/date/time format

Content of example.log:

{"level":"info","ts":1664321642.8666267,"logger":"http.log.access.log4","msg":"handled request","request":{"remote_ip":"80.61.162.165","remote_port":"56620","proto":"HTTP/2.0","method":"GET","host":"dsmr.mydomain.org","uri":"/","headers":{"User-Agent":["curl/7.74.0"],"Accept":["*/*"]},"tls":{"resumed":false,"version":772,"cipher_suite":4867,"proto":"h2","server_name":"dsmr.mydomain.org"}},"user_id":"","duration":0.031647866,"size":13341,"status":200,"resp_headers":{"Date":["Tue, 27 Sep 2022 23:34:02 GMT"],"Content-Language":["en"],"X-Content-Type-Options":["nosniff"],"Vary":["Accept-Language"],"Alt-Svc":["h3=\":443\"; ma=2592000"],"X-Frame-Options":["DENY"],"Content-Length":["13341"],"Referrer-Policy":["same-origin"],"Content-Type":["text/html; charset=utf-8"],"Server":["Caddy","nginx"]}}
{"level":"info","ts":1664321702.6594148,"logger":"http.log.access.log4","msg":"handled request","request":{"remote_ip":"80.61.162.165","remote_port":"56634","proto":"HTTP/2.0","method":"GET","host":"dsmr.mydomain.org","uri":"/","headers":{"User-Agent":["curl/7.74.0"],"Accept":["*/*"]},"tls":{"resumed":false,"version":772,"cipher_suite":4867,"proto":"h2","server_name":"dsmr.mydomain.org"}},"user_id":"","duration":0.042757547,"size":13341,"status":200,"resp_headers":{"X-Frame-Options":["DENY"],"Content-Type":["text/html; charset=utf-8"],"Server":["Caddy","nginx"],"Content-Length":["13341"],"Referrer-Policy":["same-origin"],"Vary":["Accept-Language"],"X-Content-Type-Options":["nosniff"],"Content-Language":["en"],"Date":["Tue, 27 Sep 2022 23:35:02 GMT"],"Alt-Svc":["h3=\":443\"; ma=2592000"]}}

@allinurl
Copy link
Owner

Please make sure to upgrade to the latest version of goaccess. It should address the issue. Let me know. Thanks

@rogierlommers
Copy link
Author

Please make sure to upgrade to the latest version of goaccess. It should address the issue. Let me know. Thanks

Oh my god, sorry! For some reason I was in the assumption that Ubuntu's apt-get install version was @ latest. Ticket can be closed.

@allinurl
Copy link
Owner

allinurl commented Oct 1, 2022

No problem. Feel free to use the official deb repo to stay up-to-date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants