Filebeat adds escape character to message field. How to disable that?


#1

Hi,

I'm using filebeat 5.3.0 and reading logs and send to a Kafka cluster.

The original message is something like this:

`"{"timestamp":"2017-05-04T17:03:45.020159+0800","flow_id":1692358547391513,"event_type":"flow","dest_port":53,"proto":"UDP".....}"`

Then in Kafka, the message appear as:

{"@timestamp":"2017-05-04T09:27:06.332Z","beat":{"hostname":"server","name":"server","version":"5.3.0"},"input_type":"log","message":"{\"timestamp\":\"2017-05-04T17:03:45.020159+0800\",\"flow_id\":1692358547391513,\"event_type\":\"flow\",\"dest_port\":53,\"proto\":\"UDP\".....}","offset":11739355........}

With every quotation marks added with the escape character.

Is there a way to prevent that from happening?


(ruflin) #2

It seems you are not using the json feature in filebeat. here can find more infos: https://www.elastic.co/guide/en/beats/filebeat/master/configuration-filebeat-options.html#config-json


#3

Hi,

thanks for the help!

I've added json.keys_under_root: true inside the filebeat configuration and it resolves the situation I had trouble with!


(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.