# Generating events from JSON array inside root-level object

**URL:** <https://discuss.elastic.co/t/generating-events-from-json-array-inside-root-level-object/187386>\
**Category:** Logstash\
**Created:** [June 25, 2019, 4:39pm UTC](https://discuss.elastic.co/t/generating-events-from-json-array-inside-root-level-object/187386 "2019-06-25T16:39:22Z")\
**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:** [June 25, 2019, 4:56pm UTC](https://discuss.elastic.co/t/generating-events-from-json-array-inside-root-level-object/187386/2 "2019-06-25T16:56:50Z")

</div>

Use a split filter

```
    mutate { remove_field => ["messages"] }
    split { field => "datapoints" }

```

You can move the fields to the root level using [How to dynamically move nested key value to root level](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/generating-events-from-json-array-inside-root-level-object/187386)._
