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

level detection does not correctly detect "warning" level #14443

Closed
trevorwhitney opened this issue Oct 9, 2024 · 0 comments · Fixed by #14444
Closed

level detection does not correctly detect "warning" level #14443

trevorwhitney opened this issue Oct 9, 2024 · 0 comments · Fixed by #14444

Comments

@trevorwhitney
Copy link
Collaborator

Describe the bug
If you try to detect the log level from a structured log (ie. json) that has a level and/or severity field set to "warning" or "WARNING", it will not correctly identify it and will instead fall through to the logic in detectLevelFromLogLine. If there is a string anywhere in the log line such as "info" or "error", those levels will be picked first (as the logic is sequential), and the log will be mis-identified.

To Reproduce
Steps to reproduce the behavior:

  1. Started Loki (main)
  2. Submit the following log line
{
  "message":"An error occurred using a transaction.",
  "level":"WARNING",
  "severity":"WARNING"
}
  1. Query the stream
  2. The log will have the detected_field structured metadata field set to error instead of warn

Expected behavior
The log should be labeled as warn.

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

Successfully merging a pull request may close this issue.

1 participant