-
Notifications
You must be signed in to change notification settings - Fork 162
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
Traefik Logs Parser Fails on Non-JSON Logs #1204
Comments
Hey 👋🏻 Thank you opening an issue. So there an issue with trying to guess if the log line is a not a JSON log line, since traefik supports logging "plain text" known as "CLF" also so what we could do is test if However, an easier solution I seen is making sure general traefik log messages and access logs go to different files (which you configure crowdsec to only monitor the access logs) or if both go to stdout then divert general traefik messages to a file instead. |
This is my acqui.yaml, which I believe already only logs from access logs.
|
The
crowdsecurity/traefik-logs
parser fails when encountering non-JSON log lines, such as those generated by GeoBlock. These logs are plain text and not in JSON format, causing theUnmarshalJSON
function to throw an error. This results in the following error message:This happens because the parser attempts to process all log lines, including non-JSON lines, which are incompatible with the
UnmarshalJSON
function.Steps to Reproduce:
crowdsecurity/traefik-logs
parser in CrowdSec.INFO: GeoBlock
).Expected Behavior:
The
crowdsecurity/traefik-logs
parser should:Actual Behavior:
The parser fails when encountering non-JSON log lines, causing errors like:
Environment:
Additional Context:
GeoBlock logs are plain text logs generated by Traefik, such as:
These logs are not in JSON format and should not be processed by the
crowdsecurity/traefik-logs
parser. Including a filter to exclude non-JSON lines would resolve this issue and prevent unnecessary errors.The text was updated successfully, but these errors were encountered: