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

What is the proper way to parse when logs are json? #105

Open
mitcheaton1 opened this issue Oct 24, 2019 · 3 comments
Open

What is the proper way to parse when logs are json? #105

mitcheaton1 opened this issue Oct 24, 2019 · 3 comments

Comments

@mitcheaton1
Copy link

mitcheaton1 commented Oct 24, 2019

we tried

kubetail -j <pod> -n <namespace>

we get:

backend/0 is not defined at <top-level>, line 1:
. as $line | try (fromjson | <pod name> ) catch $line

Am i calling this correctly? Our logs for a particular service output as json

@johanhaleby
Copy link
Owner

-j is for applying a jq filter. Doesn't that work for you? I personally don't have access to any services that has structural json logging so I've never used this myself. It was a PR from the community that I've not used. If it's not working properly maybe you could help out and fix it?

@mitcheaton1
Copy link
Author

Yeah, it doesn't work, and I have jq installed. i get the error listed above. I can try to see about fixing it. Thanks!

@towolf
Copy link
Contributor

towolf commented Feb 17, 2020

You need to specify a filter, so e.g., . is the simplest filter.

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

No branches or pull requests

3 participants