# Preety print json in output

**URL:** <https://discuss.elastic.co/t/preety-print-json-in-output/198078>\
**Category:** Logstash\
**Created:** [September 4, 2019, 4:40pm UTC](https://discuss.elastic.co/t/preety-print-json-in-output/198078 "2019-09-04T16:40:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ulka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ulka/32/52644_2.png) [@Ulka](https://discuss.elastic.co/u/Ulka)\
**Post date:** [September 4, 2019, 4:40pm UTC](https://discuss.elastic.co/t/preety-print-json-in-output/198078/1 "2019-09-04T16:40:27Z")

</div>

I am using filbeat as input and Elastic search as output.  
using json filter to parse json msgs.  
But I dont see output coming in proper json format (preety print) in Kibana .

I tried with Ruby filter to print preety json and can see output well kibana but logstash logs throws ruby exception  
[logstash.filters.ruby] Ruby exception occurred: A JSON text must at least contain two octets!

If I am not wrong, this comes if logstash tries to parse empty string.

few questions:

1. why with json filter , I don't see preety print output?
2. any other way than ruby filter ?
3. how to handle empty msgs?

---

<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:** [October 2, 2019, 4:40pm UTC](https://discuss.elastic.co/t/preety-print-json-in-output/198078/2 "2019-10-02T16:40:34Z")

</div>

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