# Filebeat Kafka output message compression

**URL:** <https://discuss.elastic.co/t/filebeat-kafka-output-message-compression/153916>\
**Category:** Beats\
**Created:** [October 25, 2018, 6:13am UTC](https://discuss.elastic.co/t/filebeat-kafka-output-message-compression/153916 "2018-10-25T06:13:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mruthyu](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@mruthyu](https://discuss.elastic.co/u/mruthyu)\
**Post date:** [October 25, 2018, 6:13am UTC](https://discuss.elastic.co/t/filebeat-kafka-output-message-compression/153916/1 "2018-10-25T06:13:13Z")

</div>

Would like to know whether filebeat compresses the log events before sending to Kafka.

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [October 29, 2018, 9:13pm UTC](https://discuss.elastic.co/t/filebeat-kafka-output-message-compression/153916/2 "2018-10-29T21:13:31Z")

</div>

Hi @mruthyu,

Yes, Kafka output uses compression. Default codec is `gzip`, and it can be changed with the [`compression`](https://www.elastic.co/guide/en/beats/filebeat/6.4/kafka-output.html#_literal_compression_literal) setting.

---

<div class="post-metadata">

**Author:** ![mruthyu](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@mruthyu](https://discuss.elastic.co/u/mruthyu)\
**Post date:** [October 31, 2018, 7:40am UTC](https://discuss.elastic.co/t/filebeat-kafka-output-message-compression/153916/3 "2018-10-31T07:40:10Z")

</div>

Thanks. So whether the gzip format message is stored in Kafka? And when logstash reads from the kafka input whether it will decompress it?

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [October 31, 2018, 1:11pm UTC](https://discuss.elastic.co/t/filebeat-kafka-output-message-compression/153916/4 "2018-10-31T13:11:20Z")

</div>

Yes, the message is stored as sent by the producer and decompressed if needed by the consumer, logstash in this case.

---

<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:** [November 28, 2018, 3:11pm UTC](https://discuss.elastic.co/t/filebeat-kafka-output-message-compression/153916/5 "2018-11-28T15:11:27Z")

</div>

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