# Parse complex JSON with filter

**URL:** <https://discuss.elastic.co/t/parse-complex-json-with-filter/65251>\
**Category:** Logstash\
**Created:** [November 7, 2016, 5:15pm UTC](https://discuss.elastic.co/t/parse-complex-json-with-filter/65251 "2016-11-07T17:15:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vmcano](https://avatars.discourse-cdn.com/v4/letter/v/f1d935/32.png) [@vmcano](https://discuss.elastic.co/u/vmcano)\
**Post date:** [November 7, 2016, 5:15pm UTC](https://discuss.elastic.co/t/parse-complex-json-with-filter/65251/1 "2016-11-07T17:15:22Z")

</div>

Hi all,

I am trying to parse a complex JSON with nested JSONs and JSON filter is not working properly. It parses correctly the "first level" in the JSON structure, but it doesn't do the same with the nested JSONs.

I know it is possible to do it with a Ruby filter but I wonder if there is a way to do it with the predefined filter.

One important point is that I would like a dynamic filter. I mean that I don't want to have to specify the name of the field that contains the nested JSON.

Could someone help me?

---

<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:** [November 8, 2016, 7:56pm UTC](https://discuss.elastic.co/t/parse-complex-json-with-filter/65251/2 "2016-11-08T19:56:15Z")

</div>

The ruby filter is your best bet.

---

<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:** [December 6, 2016, 7:56pm UTC](https://discuss.elastic.co/t/parse-complex-json-with-filter/65251/3 "2016-12-06T19:56:18Z")

</div>

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