# Compress output from logstash

**URL:** <https://discuss.elastic.co/t/compress-output-from-logstash/121104>\
**Category:** Logstash\
**Created:** [February 22, 2018, 5:40pm UTC](https://discuss.elastic.co/t/compress-output-from-logstash/121104 "2018-02-22T17:40:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![yofa](https://avatars.discourse-cdn.com/v4/letter/y/f05b48/32.png) [@yofa](https://discuss.elastic.co/u/yofa)\
**Post date:** [February 22, 2018, 5:40pm UTC](https://discuss.elastic.co/t/compress-output-from-logstash/121104/1 "2018-02-22T17:40:17Z")

</div>

Greetings,

I'm new to ELK and all the stuff. I've been reading the documentation to have a better understanding of elastic's products and, as far I've seen, couldn't find a solution for the case below:

I'm trying to receive syslog from 3rd party embedded systems directly into logstash, compress it and send to another logstash which will decompress and send to our log management.

Simplifying:  
enviroment #1(syslog server -\> logstash) -\> internet(compressed data) -\> environment #2 (logstash -\> uncompressed data -\> log management).

The idea is to compress data focusing on saving bandwidth.

Also, I'm trying to cipher this data. Will this mess up the idea above?

Thanks in advance.

PS: English isn't my first language, so, sorry for any misspelled word or unsense sentence.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [February 22, 2018, 6:36pm UTC](https://discuss.elastic.co/t/compress-output-from-logstash/121104/2 "2018-02-22T18:36:05Z")

</div>

You can use a [lumberjack output plugin](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-lumberjack.html) combined with a [beats input plugin](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-beats.html). This combination will compress and encrypt data being transferred between the Logstash instances.

---

<div class="post-metadata">

**Author:** ![yofa](https://avatars.discourse-cdn.com/v4/letter/y/f05b48/32.png) [@yofa](https://discuss.elastic.co/u/yofa)\
**Post date:** [February 22, 2018, 7:32pm UTC](https://discuss.elastic.co/t/compress-output-from-logstash/121104/3 "2018-02-22T19:32:32Z")

</div>

Hi Christian,  
Thank you for your suggestion.  
I was reading lumberjack documentation and the field I need to configure about compression it's the [flush\_size](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-lumberjack.html#plugins-outputs-lumberjack-flush_size), right?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [February 22, 2018, 10:02pm UTC](https://discuss.elastic.co/t/compress-output-from-logstash/121104/4 "2018-02-22T22:02:50Z")

</div>

> I was reading lumberjack documentation and the field I need to configure about compression it's the flush\_size, right?

No. that option has nothing to do with compression. Compression is always enabled.

---

<div class="post-metadata">

**Author:** ![yofa](https://avatars.discourse-cdn.com/v4/letter/y/f05b48/32.png) [@yofa](https://discuss.elastic.co/u/yofa)\
**Post date:** [February 23, 2018, 11:33am UTC](https://discuss.elastic.co/t/compress-output-from-logstash/121104/5 "2018-02-23T11:33:36Z")

</div>

I see.

So, basically, will be working this way:

logstash(lumberjack.compress(beat.cipher(log))) ---\> logstash(lumberjack.uncompress(beat.decipher(log))) ---\> log management

Have I understood right?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [February 23, 2018, 11:43am UTC](https://discuss.elastic.co/t/compress-output-from-logstash/121104/6 "2018-02-23T11:43:20Z")

</div>

Yes, that's the idea.

---

<div class="post-metadata">

**Author:** ![yofa](https://avatars.discourse-cdn.com/v4/letter/y/f05b48/32.png) [@yofa](https://discuss.elastic.co/u/yofa)\
**Post date:** [February 23, 2018, 11:53am UTC](https://discuss.elastic.co/t/compress-output-from-logstash/121104/7 "2018-02-23T11:53:36Z")

</div>

Great!

Thank you very much, Magnus and Christian!

Have a good weekend.

---

<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:** [March 23, 2018, 11:53am UTC](https://discuss.elastic.co/t/compress-output-from-logstash/121104/8 "2018-03-23T11:53:46Z")

</div>

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