# How to ingest multiple json documents from a folder into ES using logstash

**URL:** <https://discuss.elastic.co/t/how-to-ingest-multiple-json-documents-from-a-folder-into-es-using-logstash/36866>\
**Category:** Logstash\
**Created:** [December 10, 2015, 10:41am UTC](https://discuss.elastic.co/t/how-to-ingest-multiple-json-documents-from-a-folder-into-es-using-logstash/36866 "2015-12-10T10:41:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steve64](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@Steve64](https://discuss.elastic.co/u/Steve64)\
**Post date:** [December 10, 2015, 10:41am UTC](https://discuss.elastic.co/t/how-to-ingest-multiple-json-documents-from-a-folder-into-es-using-logstash/36866/1 "2015-12-10T10:41:23Z")

</div>

Continuing the discussion from [Ingesting JSON files, format problem?](https://discuss.elastic.co/t/ingesting-json-files-format-problem/36411):

> [@Ingesting JSON files, format problem?](https://discuss.elastic.co/t/ingesting-json-files-format-problem/36411/1):
>
> I have a series of JSON files, each with one rather large, single-line JSON document. I'm trying to ingest via the file input plugin:
> 
> ```
> input{
> file{
> path => "/path/to/files/*.txt"
> start-position => "beginning"
> sincedb_path => "/dev/null"
> codec => "json"
> }
> }
> output{
> stdout{ codec => rubydebug }
> }
> 
> ```
> 
> I think there's something wrong with my json format because it works when I put a test.txt file in that folder with content:  
> `{"test1":"test2"}`
> 
> The series of json files I want to ingest are of the format:
> 
> `{"messages":[{"text": ["The result was retrieved successfully."], "level": "INFO"}], "results":[{"field1": "value1", "field2": [{"field2a": "value2a", "field2b": "value2b"}], "field3": "value3"}]}`
> 
> Is there a problem here? I don't get any errors and the files are found but I see nothing from rubydebug. Could it be the length of the files, they are a couple MB each.

---

<div class="post-metadata">

**Author:** ![rclarke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rclarke/32/68604_2.png) [@rclarke](https://discuss.elastic.co/u/rclarke)\
**Post date:** [December 10, 2015, 11:01am UTC](https://discuss.elastic.co/t/how-to-ingest-multiple-json-documents-from-a-folder-into-es-using-logstash/36866/2 "2015-12-10T11:01:13Z")

</div>

Hello Steve,

That should work. Could you check that the json files also match the pattern `*.txt` ?

Cheers,  
-Robin-

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 5:19am UTC](https://discuss.elastic.co/t/how-to-ingest-multiple-json-documents-from-a-folder-into-es-using-logstash/36866/3 "2017-07-06T05:19:08Z")

</div>


