# When to use codecs in ouput?

**URL:** <https://discuss.elastic.co/t/when-to-use-codecs-in-ouput/106956>\
**Category:** Logstash\
**Created:** [November 9, 2017, 2:49am UTC](https://discuss.elastic.co/t/when-to-use-codecs-in-ouput/106956 "2017-11-09T02:49:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sjaak01](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Sjaak01](https://discuss.elastic.co/u/Sjaak01)\
**Post date:** [November 9, 2017, 2:49am UTC](https://discuss.elastic.co/t/when-to-use-codecs-in-ouput/106956/1 "2017-11-09T02:49:51Z")

</div>

Hi,

When would you use a codec in your output?

I have a remote logstash instance outputting data to a file with gzip compression. The compressed file will be sent to a storage server from which the main logstash is reading before sending the data to Elastic.

Example remote site:

Input  
Codec: netflow

filter  
do some things

output  
file  
codec (would be JSON I guess)

Main logstash server  
input  
file

filter  
do something

output  
elastic

Would it make sense to have the remote site output formatted with the netflow codec and will that actually work? I don't understand when you'd want to use an output codec to re-encode your data and what the effect is when you use filters to edit the data as I assume that means it doesn't match codec templates anymore.

output

---

<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:** [December 7, 2017, 2:49am UTC](https://discuss.elastic.co/t/when-to-use-codecs-in-ouput/106956/2 "2017-12-07T02:49:57Z")

</div>

Closed on December 7, 2017, 2:49am UTC

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