# Logstash output pretty json file?

**URL:** <https://discuss.elastic.co/t/logstash-output-pretty-json-file/196520>\
**Category:** Logstash\
**Created:** [August 23, 2019, 12:47pm UTC](https://discuss.elastic.co/t/logstash-output-pretty-json-file/196520 "2019-08-23T12:47:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [August 23, 2019, 12:47pm UTC](https://discuss.elastic.co/t/logstash-output-pretty-json-file/196520/1 "2019-08-23T12:47:19Z")

</div>

Hi,

I know, that I can use json\_lines codec for file output to generate a one json line per event.

Is there also a possibility to create a pretty json file as file output which is easier readable for humans?

Thanks, Andras

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [August 23, 2019, 2:10pm UTC](https://discuss.elastic.co/t/logstash-output-pretty-json-file/196520/2 "2019-08-23T14:10:33Z")

</div>

It's not JSON, but the rubydebug codec is intended to be easily readable. If you really want pretty-printed JSON then you could try [this](https://stackoverflow.com/questions/42926514/pretty-print-json-document-in-logstash-5).

---

<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:** [September 20, 2019, 2:10pm UTC](https://discuss.elastic.co/t/logstash-output-pretty-json-file/196520/3 "2019-09-20T14:10:33Z")

</div>

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