# Parsing nested json to flat structure

**URL:** <https://discuss.elastic.co/t/parsing-nested-json-to-flat-structure/286790>\
**Category:** Logstash\
**Created:** [October 15, 2021, 3:36am UTC](https://discuss.elastic.co/t/parsing-nested-json-to-flat-structure/286790 "2021-10-15T03:36:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [October 15, 2021, 4:50pm UTC](https://discuss.elastic.co/t/parsing-nested-json-to-flat-structure/286790/2 "2021-10-15T16:50:36Z")

</div>

The json filter will parse all of the nested JSON objects and create hashes from them. The json filter parses a string, which is why you get that error about casting a RubyHash to a RubyIO.

If you want to move the nested objects to the top level and you know their names you can use code like [this](https://discuss.elastic.co/t/how-to-dynamically-move-nested-key-value-to-root-level/180006/2).

---

_[View the full topic](https://discuss.elastic.co/t/parsing-nested-json-to-flat-structure/286790)._
