# Parse json "message" into separate fields in Kibana

**URL:** <https://discuss.elastic.co/t/parse-json-message-into-separate-fields-in-kibana/164572>\
**Category:** Logstash\
**Created:** [January 17, 2019, 6:22am UTC](https://discuss.elastic.co/t/parse-json-message-into-separate-fields-in-kibana/164572 "2019-01-17T06:22:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yash\_sachdeva](https://avatars.discourse-cdn.com/v4/letter/y/bcef8e/32.png) [@yash\_sachdeva](https://discuss.elastic.co/u/yash_sachdeva)\
**Post date:** [January 17, 2019, 6:22am UTC](https://discuss.elastic.co/t/parse-json-message-into-separate-fields-in-kibana/164572/1 "2019-01-17T06:22:42Z")

</div>

Hi Team,

I am looking to parse my json message into individual fields in Kibana. I have been trying out a lot of the recommendations online and on this forum but to no avail.  
The conf file I have created is as follows:

input {

gelf {  
type =\> "log"  
add\_field =\> { "log\_level" =\> "-" }  
codec =\> json  
}  
}

filter {

if [type]== "log" {  
json {  
source =\> "message"  
}  
}  
}

output {

if [type] == "log" {  
elasticsearch {  
hosts =\> ["elasticsearch"]  
index =\> "logstash-logs-%{+YYYY.MM.dd}"  
}  
}  
}

And my JSON message looks like this :  
{"time": "2019-01-17T06:13:56.618263", "event": "response", "log\_type": "test-api", "request\_unique\_id": "fe32285e-504d-46a1-bd87-78640232cb0b", "URL": "[http://localhost/debug/db\_connection\_status](http://localhost/debug/db_connection_status)", "method": "GET", "device\_info": "Docker Health Check", "request\_user": "", "remote\_addr": "127.0.6.6", "server\_protocol": "http", "status\_code": 200, "processing\_time": 0.0019574579782783985}

Could you please help in figuring where I am going wrong as the above json is writtend altogether in a "message" field and not as individual key-value fields

---

<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:** [January 17, 2019, 1:49pm UTC](https://discuss.elastic.co/t/parse-json-message-into-separate-fields-in-kibana/164572/2 "2019-01-17T13:49:54Z")

</div>

You do not need both a json codec and a json filter, use one or the other. Does the log\_level field get added to your events?

---

<div class="post-metadata">

**Author:** ![yash\_sachdeva](https://avatars.discourse-cdn.com/v4/letter/y/bcef8e/32.png) [@yash\_sachdeva](https://discuss.elastic.co/u/yash_sachdeva)\
**Post date:** [January 18, 2019, 5:22am UTC](https://discuss.elastic.co/t/parse-json-message-into-separate-fields-in-kibana/164572/3 "2019-01-18T05:22:47Z")

</div>

Hi Badger, thanks! that worked!

---

<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:** [February 15, 2019, 5:22am UTC](https://discuss.elastic.co/t/parse-json-message-into-separate-fields-in-kibana/164572/4 "2019-02-15T05:22:51Z")

</div>

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