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 log not getting parsed to the output record fields #181

Closed
ericln opened this issue Aug 11, 2018 · 3 comments
Closed

json log not getting parsed to the output record fields #181

ericln opened this issue Aug 11, 2018 · 3 comments

Comments

@ericln
Copy link

ericln commented Aug 11, 2018

I have tried using both fluent/fluentd-kubernetes-daemonset:v0.12-alpine-elasticsearch and fluent/fluentd-kubernetes-daemonset:elasticsearch images in my k8s cluster with default fluent.conf and kubernetes.conf. However, the json format log fields doesn't get parsed into output record fields when sending to elasticsearch.

am I missing some configurations ?

just a note, i have another older cluster running with fluent/fluentd-kubernetes-daemonset:v0.12-alpine-elasticsearch image that was pull couple month prior is parsing the json log fine.

thanks

@repeatedly
Copy link
Member

You need to put filter parser in your pipeline: https://docs.fluentd.org/v1.0/articles/filter_parser
See fluent/fluentd#2073 for more details.

We will add README about this point.

@lentzi90
Copy link

To help others coming here looking for solutions: Note that there are two different versions for fluentd and that the configuration syntax has changed for the filter plugin.
Compare v0.12 and v1.0.

This comment worked for me with v1.4.2-debian-elasticsearch-1.0, but you may be interested in this if you run some other version.

@ericln
Copy link
Author

ericln commented Jun 28, 2019

@lentzi90 thanks, that worked for me too by adding the following

<filter kubernetes.var.log.containers.**>
  @type parser
  format json
  key_name log
  reserve_time true
  reserve_data true
  emit_invalid_record_to_error false
</filter>

@ericln ericln closed this as completed Jun 28, 2019
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