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

json logs are not parsed #44

Closed
lx223 opened this issue Feb 13, 2020 · 8 comments
Closed

json logs are not parsed #44

lx223 opened this issue Feb 13, 2020 · 8 comments

Comments

@lx223
Copy link

lx223 commented Feb 13, 2020

Hi there, I am trying to hook my k8s cluster to ship logs to logz using this repo. Currently, I am getting issues where the application's json logs are not parsed.

In Kibana table view: message: {"level":"info","msg":"log message","time":"2020-01-12T15:43:28Z"}

I was expecting it to be parsed recursively like the k8s ones. Can you please help me fix it?

Possibly related to something like this: fluent/fluentd-kubernetes-daemonset#328

@idohalevi
Copy link
Contributor

@lx223 thank you for the detailed issue. @yyyogev can you take a look next week?

@yyyogev
Copy link
Contributor

yyyogev commented Feb 16, 2020

@lx223 we pushed a test image with a fix, try it and let us know if it works out
try logzio/logzio-k8s:test instead of logzio/logzio-k8s:latest

@lx223
Copy link
Author

lx223 commented Feb 16, 2020

Hi @yyyogev, thanks for the new image. I just tried it. It worked partially.

Most of the fields are now parsed correctly. But just the message field is missing. For example, the following log entry would contain every field such as level, logger but not the message field.

{"level":"INFO","logger":"io.dropwizard.server.DefaultServerFactory","thread":"main","message":"Regstering jersey handler with root path prefix: /","service-name":"main-service","timestamp":"2020-02-16T15:40:08.367Z"}

@yyyogev
Copy link
Contributor

yyyogev commented Feb 16, 2020

@lx223 is the message itself moved under another field or dropped entirely?

@lx223
Copy link
Author

lx223 commented Feb 16, 2020

@yyyogev dropped entirely

@yyyogev
Copy link
Contributor

yyyogev commented Feb 17, 2020

Probably because they have the same name.. Currently, I don't see a way around this problem

@lx223
Copy link
Author

lx223 commented Feb 17, 2020

Thanks @yyyogev. I can remap the message field to different name. It's probably worth being documented as it would come as a surprise especially when there are third-party software where json fields cannot be easily remapped. Please let me know when the new change is released.

@yyyogev
Copy link
Contributor

yyyogev commented Feb 20, 2020

@lx223 you could also use our support to parse the json-as-string from a specific field

@yyyogev yyyogev closed this as completed Feb 20, 2020
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