# \[SOLVED\] Logstash logging in JSON format

**URL:** https://discuss.elastic.co/t/solved-logstash-logging-in-json-format/57736
**Category:** Logstash
**Created:** [August 10, 2016, 7:18pm UTC](https://discuss.elastic.co/t/solved-logstash-logging-in-json-format/57736 "2016-08-10T19:18:07Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![hartfordfive](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hartfordfive/32/44794_2.png) [@hartfordfive](https://discuss.elastic.co/u/hartfordfive)
#### Post date: [August 10, 2016, 7:18pm UTC](https://discuss.elastic.co/t/solved-logstash-logging-in-json-format/57736/1 "2016-08-10T19:18:07Z")

</div>

Currently, Logstash application logs are in Ruby debug format although I'd like to have them in JSON format instead. From what I can see, this isn't currently possible, although could this be added as potential feature?

---

<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: [August 11, 2016, 5:47am UTC](https://discuss.elastic.co/t/solved-logstash-logging-in-json-format/57736/2 "2016-08-11T05:47:51Z")

</div>

Judging by the issue below it looks like it'll be available in Logstash 5.0.

> <https://github.com/elastic/logstash/issues/5650>

---

<div class="post-metadata">

### Author: ![purbon](https://avatars.discourse-cdn.com/v4/letter/p/edb3f5/32.png) [@purbon](https://discuss.elastic.co/u/purbon)
#### Post date: [August 11, 2016, 7:34am UTC](https://discuss.elastic.co/t/solved-logstash-logging-in-json-format/57736/3 "2016-08-11T07:34:35Z")

</div>

HI,  
currently It has been merged in the support to log in json format, see

> <https://github.com/elastic/logstash/pull/4820>

From this PR:

```auto
This is made available by a --log-in-json flag. Default is false.
When false, the old behavior [1] is used.

When true, JSON logs are emitted.

[1] The old behavior is realy two things. First, using Object#inspect to
serialize. Second, to color the output if the IO is a tty.

```

According to [https://github.com/elastic/logstash/blob/5.0/CHANGELOG.md](https://github.com/elastic/logstash/blob/5.0/CHANGELOG.md) this has been included in alpha-3 for the logstash 5.x series and into the 2.4 branch ([https://github.com/elastic/logstash/commit/39e0ef5783c26d0da1175a036c74301fd70dfe7c](https://github.com/elastic/logstash/commit/39e0ef5783c26d0da1175a036c74301fd70dfe7c)) currently unreleased.

For sure the support to logging in json format might increase it's capabilities when log4j is in as @magnusbaeck pointed out.

---

<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: [July 6, 2017, 4:43am UTC](https://discuss.elastic.co/t/solved-logstash-logging-in-json-format/57736/4 "2017-07-06T04:43:52Z")

</div>


