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

Add logfmt output #421

Open
schmidt-i opened this issue Jan 24, 2025 · 1 comment
Open

Add logfmt output #421

schmidt-i opened this issue Jan 24, 2025 · 1 comment
Labels
asDesigned question Further information is requested

Comments

@schmidt-i
Copy link




Is your feature request related to a problem? Please describe.
It is hard to parse the output of popeye with log parser when running it unattended in a kubernetes cluster. The JSON output is hard to parse since all linter infos are in an array and it seems impossible to extract labels.
A nice parseable logfmt output with predefined labels like namespace, linter, testname, type, testid and the message would make it easy to create dashboards with logql parsing.

Describe the solution you'd like
Add logfmt output that shows each linter result as a single logline with predefined labels

Describe alternatives you've considered
Parsing json logs -> Hard to achive
using cli logs -> parsing is hard and context is not given

Additional context
Useful in multiteant k8s environements to give each tenant access to their findings.

@derailed
Copy link
Owner

@schmidt-i Not sure what you mean? json outputs are not logs??
jq has not problems grocking the json output

popeye -s ns -n default -o json | jq -c '.popeye.sections[]'

{"linter":"namespaces","gvr":"v1/namespaces","tally":{"ok":1,"info":0,"warning":0,"error":0,"score":100},"issues":{}}

@derailed derailed added question Further information is requested asDesigned labels Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
asDesigned question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants