# Filebeat parsing log containing structured JSON

**URL:** <https://discuss.elastic.co/t/filebeat-parsing-log-containing-structured-json/202238>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [October 3, 2019, 8:15pm UTC](https://discuss.elastic.co/t/filebeat-parsing-log-containing-structured-json/202238 "2019-10-03T20:15:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bkleynbok](https://avatars.discourse-cdn.com/v4/letter/b/d2c977/32.png) [@bkleynbok](https://discuss.elastic.co/u/bkleynbok)\
**Post date:** [October 3, 2019, 8:15pm UTC](https://discuss.elastic.co/t/filebeat-parsing-log-containing-structured-json/202238/1 "2019-10-03T20:15:53Z")

</div>

Running ELK Stack 7.3.2 on Linux

I am trying to parse JSON via FIilebeat then output to Elasticsearch and show individual objects of the structured JSON in Kibana.

Here is test.json  
[  
{  
"employee": {  
"firstName": "Lokesh",  
"lastName": "Gupta",  
"website": "[howtodoinjava.com](http://howtodoinjava.com)"  
}  
},  
{  
"employee": {  
"firstName": "Brian",  
"lastName": "Schultz",  
"website": "[example.com](http://example.com)"  
}  
}  
]

Here is my filebeat.yml  
filebeat.inputs:

- type: log

output.elasticsearch:  
hosts: ["[http://myhost:9200](http://myhost:9200)"]

I am not able to parse structured JSON

---

<div class="post-metadata">

**Author:** ![Michael\_Madden](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael_madden/32/46640_2.png) [@Michael\_Madden](https://discuss.elastic.co/u/Michael_Madden)\
**Post date:** [October 4, 2019, 1:23am UTC](https://discuss.elastic.co/t/filebeat-parsing-log-containing-structured-json/202238/2 "2019-10-04T01:23:38Z")

</div>

Hello, do you get an errors when you try to decode your test JSON data? I believe you're on the right track. I was going to suggest using `decode_json_fields`, but I see it's already in your configuration.

---

<div class="post-metadata">

**Author:** ![bkleynbok](https://avatars.discourse-cdn.com/v4/letter/b/d2c977/32.png) [@bkleynbok](https://discuss.elastic.co/u/bkleynbok)\
**Post date:** [October 4, 2019, 12:49pm UTC](https://discuss.elastic.co/t/filebeat-parsing-log-containing-structured-json/202238/3 "2019-10-04T12:49:37Z")

</div>

Nothing gets parsed. I tried a one line JSON in the test.json file.

{ "firstName": "Lokesh","lastName": "Gupta" }

No Elastic search index gets created.

---

<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 1, 2019, 12:49pm UTC](https://discuss.elastic.co/t/filebeat-parsing-log-containing-structured-json/202238/4 "2019-11-01T12:49:40Z")

</div>

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