# S3 Output Plugin: Correct Way to manage codec

**URL:** <https://discuss.elastic.co/t/s3-output-plugin-correct-way-to-manage-codec/282103>\
**Category:** Logstash\
**Created:** [August 20, 2021, 5:12pm UTC](https://discuss.elastic.co/t/s3-output-plugin-correct-way-to-manage-codec/282103 "2021-08-20T17:12:43Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Hammond95](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hammond95/32/93591_2.png) [@Hammond95](https://discuss.elastic.co/u/Hammond95)\
**Post date:** [August 23, 2021, 5:21pm UTC](https://discuss.elastic.co/t/s3-output-plugin-correct-way-to-manage-codec/282103/2 "2021-08-23T17:21:01Z")

</div>

I managed to solve my problem.

I missed it both from the logs and the docs, but actually this codec plugin (csv) doesn't come installed, so you have to install it first with:

`bin/logstash-plugin install logstash-codec-csv`

After that I had to escape newline from fields to avoid unwanted line breaks:

```auto
mutate {
    gsub => ["[Query]", "[\n]", "\\\\n" ]
    gsub => ["[PreparedQuery]", "[\n]", "\\\\n" ]
}

```

The plugin will take care of doubling any double quote in the data (that's how you escape doublequotes).

For the separator I have opened another thread in the forum, see:

> [@S3 CSV Codec - Using a non printable character as separator](https://discuss.elastic.co/t/s3-csv-codec-using-a-non-printable-character-as-separator/282262):
>
> Is it possible to use a non printable character as a separator in the csv codec? codec =\> csv { columns =\> ["col1", "col2", "col3"] charset =\> "UTF-8" separator =\> "\\u001F" } I have tried the following: \u001f, \u001F, \\u001f, \\u001F, \u{001F} some ideas? If this is not possible, how would I have to modify the code to make it possible?

---

_[View the full topic](https://discuss.elastic.co/t/s3-output-plugin-correct-way-to-manage-codec/282103)._
