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

**URL:** <https://discuss.elastic.co/t/filebeat-adds-escape-character-to-message-field-how-to-disable-that/84908>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [May 8, 2017, 9:33am UTC](https://discuss.elastic.co/t/filebeat-adds-escape-character-to-message-field-how-to-disable-that/84908 "2017-05-08T09:33:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tskeng](https://avatars.discourse-cdn.com/v4/letter/t/4af34b/32.png) [@tskeng](https://discuss.elastic.co/u/tskeng)\
**Post date:** [May 8, 2017, 9:33am UTC](https://discuss.elastic.co/t/filebeat-adds-escape-character-to-message-field-how-to-disable-that/84908/1 "2017-05-08T09:33:23Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [May 9, 2017, 9:26am UTC](https://discuss.elastic.co/t/filebeat-adds-escape-character-to-message-field-how-to-disable-that/84908/2 "2017-05-09T09:26:59Z")

</div>

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](https://www.elastic.co/guide/en/beats/filebeat/master/configuration-filebeat-options.html#config-json)

---

<div class="post-metadata">

**Author:** ![tskeng](https://avatars.discourse-cdn.com/v4/letter/t/4af34b/32.png) [@tskeng](https://discuss.elastic.co/u/tskeng)\
**Post date:** [May 9, 2017, 9:51am UTC](https://discuss.elastic.co/t/filebeat-adds-escape-character-to-message-field-how-to-disable-that/84908/3 "2017-05-09T09:51:13Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 6, 2017, 10:01am UTC](https://discuss.elastic.co/t/filebeat-adds-escape-character-to-message-field-how-to-disable-that/84908/4 "2017-06-06T10:01:39Z")

</div>

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