# Logstash - Json file input question

**URL:** <https://discuss.elastic.co/t/logstash-json-file-input-question/232484>\
**Category:** Logstash\
**Created:** [May 13, 2020, 4:51pm UTC](https://discuss.elastic.co/t/logstash-json-file-input-question/232484 "2020-05-13T16:51:28Z")\
**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:** [May 13, 2020, 10:11pm UTC](https://discuss.elastic.co/t/logstash-json-file-input-question/232484/2 "2020-05-13T22:11:27Z")

</div>

You can read the entire file as a single event using a multiline codec as described [here](https://discuss.elastic.co/t/parsing-array-of-json-objects-with-logstash-and-injesting-to-elastic/203197/2).

Then use a json filter with the target option set to parse the file contents. It will parse nested fields just fine,

Then use a split filter to split the array into multiple events.

Then use a prune filter with a whitelist to discard everything except \_source.

Then use a ruby filter as described in the link at the end of that post I linked to move the contents of \_source to the top level.

---

_[View the full topic](https://discuss.elastic.co/t/logstash-json-file-input-question/232484)._
