# Formatting output of Filebeat Kafka plugin

**URL:** <https://discuss.elastic.co/t/formatting-output-of-filebeat-kafka-plugin/72528>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [January 23, 2017, 7:43pm UTC](https://discuss.elastic.co/t/formatting-output-of-filebeat-kafka-plugin/72528 "2017-01-23T19:43:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arvind\_Kalyan](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@Arvind\_Kalyan](https://discuss.elastic.co/u/Arvind_Kalyan)\
**Post date:** [January 23, 2017, 7:43pm UTC](https://discuss.elastic.co/t/formatting-output-of-filebeat-kafka-plugin/72528/1 "2017-01-23T19:43:52Z")

</div>

Hi,

Using Filebeat 5.1 (latest).  
Currently when I log one line with message "hello", it comes in Kafka as this:

`{"@timestamp":"2017-01-23T19:42:22.991Z","beat":{"hostname":"ip-10-0-14-90","name":"ip-10-0-14-90","version":"5.1.2"},"input_type":"log", **"message":"hello"** ,"offset":1010655016,"source":"/var/log/abc.log","type":"log"}`

Is there a way to get only "hello" into kafka? I don't need the meta information. I see that in Logstash, you can use format =\> "%{message}". Is a similar thing provided here?

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [January 23, 2017, 8:43pm UTC](https://discuss.elastic.co/t/formatting-output-of-filebeat-kafka-plugin/72528/2 "2017-01-23T20:43:32Z")

</div>

In Filebeat 5.2.0 there was an [enhancement](https://github.com/elastic/beats/pull/2924) to support this. The config will be done as:

```auto
output.kafka:
  codec.format:
    string: '%{[message]}'

```

See codec documentation: [https://www.elastic.co/guide/en/beats/filebeat/5.x/configuration-output-codec.html](https://www.elastic.co/guide/en/beats/filebeat/5.x/configuration-output-codec.html)

You can test with a snapshot build until 5.2.0 is released. [https://snapshots.elastic.co/downloads/beats/filebeat/filebeat-5.2.0\_SNAPSHOT-linux-x86\_64.tar.gz](https://snapshots.elastic.co/downloads/beats/filebeat/filebeat-5.2.0_SNAPSHOT-linux-x86_64.tar.gz)

---

<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:** [February 20, 2017, 8:44pm UTC](https://discuss.elastic.co/t/formatting-output-of-filebeat-kafka-plugin/72528/3 "2017-02-20T20:44:12Z")

</div>

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