# JSON LInes to JSON ARRAY

**URL:** https://discuss.elastic.co/t/json-lines-to-json-array/204300
**Category:** Logstash
**Created:** [October 19, 2019, 9:29am UTC](https://discuss.elastic.co/t/json-lines-to-json-array/204300 "2019-10-19T09:29:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Sanjay\_Agnani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sanjay_agnani/32/45398_2.png) [@Sanjay\_Agnani](https://discuss.elastic.co/u/Sanjay_Agnani)
#### Post date: [October 19, 2019, 9:29am UTC](https://discuss.elastic.co/t/json-lines-to-json-array/204300/1 "2019-10-19T09:29:33Z")

</div>

Hi All,  
We receive json lines from logs.  
would need to aggregate this json lines to json Array  
Sample:  
{  
"source" : "Request"  
"target": "Request\_parsed"  
}  
{  
"source" : "Request1"  
"target": "Request\_parsed1"  
}

Output  
[  
{  
"output": {  
"source": "Request",  
"target": "Request\_parsed"  
}  
},  
{  
"output": {  
"source": "Request1",  
"target": "Request\_parsed1"  
}  
}  
]

through mutate filter can add the field , would need to merge all fields.

---

<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: [October 19, 2019, 1:07pm UTC](https://discuss.elastic.co/t/json-lines-to-json-array/204300/2 "2019-10-19T13:07:32Z")

</div>

You can combine events using an aggregate filter.

---

<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: [November 16, 2019, 1:07pm UTC](https://discuss.elastic.co/t/json-lines-to-json-array/204300/3 "2019-11-16T13:07:34Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
