# How to parse custom logs with nested jsons

**URL:** <https://discuss.elastic.co/t/how-to-parse-custom-logs-with-nested-jsons/93349>\
**Category:** Logstash\
**Created:** [July 17, 2017, 7:33am UTC](https://discuss.elastic.co/t/how-to-parse-custom-logs-with-nested-jsons/93349 "2017-07-17T07:33:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pijain](https://avatars.discourse-cdn.com/v4/letter/p/5fc32e/32.png) [@pijain](https://discuss.elastic.co/u/pijain)\
**Post date:** [July 17, 2017, 7:33am UTC](https://discuss.elastic.co/t/how-to-parse-custom-logs-with-nested-jsons/93349/1 "2017-07-17T07:33:00Z")

</div>

How to parse the log files as below

2017-07-09 18:42:53,748 || [INFO] || default || || some\_text || some\_text || /path/to/some/python/file.py || 919 || {"key1": "value1", "key2": {"key3": "value3", "key4": "value4", "key5": "value5"}, "key6": "/some/url/"}

and store each key separately with grok.

actual logs have different set of JSONS with different keys.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [July 17, 2017, 7:38am UTC](https://discuss.elastic.co/t/how-to-parse-custom-logs-with-nested-jsons/93349/2 "2017-07-17T07:38:51Z")

</div>

It looks like you should be able to use a csv filter based on the `|` separator to parse the different parts into separate fields. You can the apply a son filter to the last field that contains the JSON document.

---

<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:** [August 14, 2017, 7:39am UTC](https://discuss.elastic.co/t/how-to-parse-custom-logs-with-nested-jsons/93349/3 "2017-08-14T07:39:08Z")

</div>

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