# S3 output plugin generates invalid json

**URL:** <https://discuss.elastic.co/t/s3-output-plugin-generates-invalid-json/233303>\
**Category:** Logstash\
**Created:** [May 19, 2020, 11:20am UTC](https://discuss.elastic.co/t/s3-output-plugin-generates-invalid-json/233303 "2020-05-19T11:20:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ram\_Jeghan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ram_jeghan/32/48128_2.png) [@Ram\_Jeghan](https://discuss.elastic.co/u/Ram_Jeghan)\
**Post date:** [May 19, 2020, 11:20am UTC](https://discuss.elastic.co/t/s3-output-plugin-generates-invalid-json/233303/1 "2020-05-19T11:20:47Z")

</div>

Hi,

We are using s3 output plugin to forward logs into an s3 bucket with json\_lines codec. The files generated are raw text files with each line containing a single quoted json file with special chars such as \n in it.

```auto
    output{
      s3{
       access_key_id => " ****"
       secret_access_key => " ****"
       region => " ****"
       bucket => " ****"
       time_file => 5
       rotation_strategy => "time"
       codec => "json_lines"
     }
    }

```

These lines couldnt be processed for example by a tool like jq or even python json libraries.

Is there any way to reprocess these files already generated? as we have GBs of such logs generated.

And is there a way to avoid this single quoted jsons with special chars to be output by the plugin?

Thank you

---

<div class="post-metadata">

**Author:** ![Ram\_Jeghan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ram_jeghan/32/48128_2.png) [@Ram\_Jeghan](https://discuss.elastic.co/u/Ram_Jeghan)\
**Post date:** [May 19, 2020, 7:49pm UTC](https://discuss.elastic.co/t/s3-output-plugin-generates-invalid-json/233303/2 "2020-05-19T19:49:55Z")

</div>

Looks these files we received were post processed outside of logstash using a python library. Causing this issue.

Updating the cause as I have identified the resolution.

---

<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:** [June 16, 2020, 7:50pm UTC](https://discuss.elastic.co/t/s3-output-plugin-generates-invalid-json/233303/3 "2020-06-16T19:50:01Z")

</div>

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