Fluentd-kubernetes-daemonset: json log not getting parsed to the output record fields

Created on 11 Aug 2018  路  3Comments  路  Source: fluent/fluentd-kubernetes-daemonset

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

Most helpful comment

@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>

All 3 comments

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

We will add README about this point.

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.

@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>
Was this page helpful?
0 / 5 - 0 ratings

Related issues

repeatedly picture repeatedly  路  11Comments

nrmitchi picture nrmitchi  路  11Comments

pckhoi picture pckhoi  路  4Comments

ozayss picture ozayss  路  4Comments

jfillman picture jfillman  路  9Comments