# Logstash extract a nested json object

**URL:** <https://discuss.elastic.co/t/logstash-extract-a-nested-json-object/265307>\
**Category:** Logstash\
**Created:** [February 24, 2021, 9:43am UTC](https://discuss.elastic.co/t/logstash-extract-a-nested-json-object/265307 "2021-02-24T09:43:13Z")\
**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:** [February 24, 2021, 2:42pm UTC](https://discuss.elastic.co/t/logstash-extract-a-nested-json-object/265307/2 "2021-02-24T14:42:06Z")

</div>

The error message shows that [fields] is an object, not a string (see [here](https://discuss.elastic.co/t/json-parsing-issue/265219/2) to understand why). You can move arbitrary fields within an object to the root using a ruby filter. See [here](https://discuss.elastic.co/t/how-to-dynamically-move-nested-key-value-to-root-level/180006/2) for an example.

---

_[View the full topic](https://discuss.elastic.co/t/logstash-extract-a-nested-json-object/265307)._
