# Logstash configuration for multiple json (nested) files in a directory

**URL:** <https://discuss.elastic.co/t/logstash-configuration-for-multiple-json-nested-files-in-a-directory/267333>\
**Category:** Logstash\
**Tags:** ingest-pipeline\
**Created:** [March 16, 2021, 8:46am UTC](https://discuss.elastic.co/t/logstash-configuration-for-multiple-json-nested-files-in-a-directory/267333 "2021-03-16T08:46:03Z")\
**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:** [March 16, 2021, 3:05pm UTC](https://discuss.elastic.co/t/logstash-configuration-for-multiple-json-nested-files-in-a-directory/267333/2 "2021-03-16T15:05:25Z")

</div>

Your [message] field is not valid JSON, so a json filter cannot parse it. Perhaps the JSON in your file is pretty-printed, in which case you need to combine lines to form a complete JSON object. You would use a multiline codec to do that. If you want to read the entire file as one event then [this](https://discuss.elastic.co/t/parsing-array-of-json-objects-with-logstash-and-injesting-to-elastic/203197/2) describes how to do that.

---

_[View the full topic](https://discuss.elastic.co/t/logstash-configuration-for-multiple-json-nested-files-in-a-directory/267333)._
