# How to output pretty json to stdout

**URL:** <https://discuss.elastic.co/t/how-to-output-pretty-json-to-stdout/151339>\
**Category:** Logstash\
**Created:** [October 7, 2018, 7:58am UTC](https://discuss.elastic.co/t/how-to-output-pretty-json-to-stdout/151339 "2018-10-07T07:58:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![panthersquirrel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/panthersquirrel/32/31548_2.png) [@panthersquirrel](https://discuss.elastic.co/u/panthersquirrel)\
**Post date:** [October 7, 2018, 7:58am UTC](https://discuss.elastic.co/t/how-to-output-pretty-json-to-stdout/151339/1 "2018-10-07T07:58:20Z")

</div>

I can't seem to find out how to output my log as pretty json to stdout. The default `rubydebug` output in my opinion is excruciating to look at. For example, I want the following log to look like this when printed to stdout:

```auto
{
  "@timestamp": "2018-10-07T05:14:10.879Z",
  "@version": "1",
  "alpha": {
    "bravo": 1,
    "charlie": {
      "delta": 2,
      "echo": 3
    },
    "foxtrot": 4
  }
}

```

Instead I get this absolute trash

```auto
{
         "@timestamp" => 2018-10-07T05:14:10.879Z,
           "@version" => "1",
              "alpha" => {
                            "bravo" => 1,
                          "charlie" => {
                "delta" => 2,
                 "echo" => 3
        },
                          "foxtrot" => 4
    }
}

```

This is driving me bananas. I tried the following

```auto
output {
  stdout { codec => json }
}

```

and it just prints

```auto
{"@timestamp":"2018-10-07T05:14:10.879Z","@version":"1","alpha":{"bravo":1,"charlie":{"delta":2,"echo":3},"foxtrot":4}}

```

If json is not available, id be fine with any format that is ALIGNED in a NORMAL alignment.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [October 9, 2018, 8:15pm UTC](https://discuss.elastic.co/t/how-to-output-pretty-json-to-stdout/151339/2 "2018-10-09T20:15:56Z")

</div>

I don't believe this is supported.

---

<div class="post-metadata">

**Author:** ![panthersquirrel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/panthersquirrel/32/31548_2.png) [@panthersquirrel](https://discuss.elastic.co/u/panthersquirrel)\
**Post date:** [October 10, 2018, 12:32pm UTC](https://discuss.elastic.co/t/how-to-output-pretty-json-to-stdout/151339/3 "2018-10-10T12:32:45Z")

</div>

ok thanks for your response!

---

<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:** [November 7, 2018, 12:32pm UTC](https://discuss.elastic.co/t/how-to-output-pretty-json-to-stdout/151339/4 "2018-11-07T12:32:50Z")

</div>

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