# Reading multiple statusfile content and mapping to nested object

**URL:** <https://discuss.elastic.co/t/reading-multiple-statusfile-content-and-mapping-to-nested-object/40737>\
**Category:** Logstash\
**Created:** [February 2, 2016, 1:52pm UTC](https://discuss.elastic.co/t/reading-multiple-statusfile-content-and-mapping-to-nested-object/40737 "2016-02-02T13:52:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![techrawther](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@techrawther](https://discuss.elastic.co/u/techrawther)\
**Post date:** [February 2, 2016, 1:52pm UTC](https://discuss.elastic.co/t/reading-multiple-statusfile-content-and-mapping-to-nested-object/40737/1 "2016-02-02T13:52:41Z")

</div>

I have a scenarios where multiple status file will be written on a NAS location continuously until a process (build) completes.

folder1/status.txt  
folder2/status.txt  
folder3/status.txt  
folder4/status.txt  
......./.........

* * *

The content of status file is mentioned below

`id : "1234" name : "xyz" place :	"santaclara" product	: product1 needs : dependent1,dependent2, os's : windows status : success product2 needs : dependent1,dependent4 os's : linux,mac status : fail build : build234 target : target234,target345, os's : linux,mac`

I tried using the "file" plugin to read data, but in that case it read by line by line. and mapping it to a nested object as mentioned below became complicate. I wanted to have all the data inside each status file as nested object in a single document. Could you please suggest\provide some direction on how should I proceed?

The nested object out put I am looking for is  
`{ id : "" name : "" place : "" product { product1 { {[needs :"dependent1", "dependent2" os's :"windows" status : "success",] } build {......} }`

Request any help on this.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [February 4, 2016, 8:13pm UTC](https://discuss.elastic.co/t/reading-multiple-statusfile-content-and-mapping-to-nested-object/40737/2 "2016-02-04T20:13:11Z")

</div>

Reading entire files in one swoop with the file input is tricky. Perhaps the [exec input](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-exec.html) would make more sense?

---

<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:13am UTC](https://discuss.elastic.co/t/reading-multiple-statusfile-content-and-mapping-to-nested-object/40737/3 "2017-07-06T05:13:01Z")

</div>


