# Split single object in array to multiple?

**URL:** https://discuss.elastic.co/t/split-single-object-in-array-to-multiple/314392
**Category:** Logstash
**Created:** [September 14, 2022, 9:37am UTC](https://discuss.elastic.co/t/split-single-object-in-array-to-multiple/314392 "2022-09-14T09:37:36Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Hamza\_Khalid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hamza_khalid/32/103313_2.png) [@Hamza\_Khalid](https://discuss.elastic.co/u/Hamza_Khalid)
#### Post date: [September 14, 2022, 9:37am UTC](https://discuss.elastic.co/t/split-single-object-in-array-to-multiple/314392/1 "2022-09-14T09:37:36Z")

</div>

I'm using logstash to index data from mysql to elasticsearch.  
**Is there a way to convert this output:**  
"interests" : [  
{  
"interest\_id" : "1,2",  
"interest\_name" : "Business,Farming"  
}  
]

**To this:**  
"interests" : [  
{  
"interest\_id" : "1",  
"interest\_name" : "Business"  
},  
"interest\_id" : "2",  
"interest\_name" : ",Farming"  
]

**from filter section in logstash.**  
Please help i'm trying to do this since couple of days i tried using split filter but it didn't work.

---

<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: [October 12, 2022, 9:37am UTC](https://discuss.elastic.co/t/split-single-object-in-array-to-multiple/314392/2 "2022-10-12T09:37:39Z")

</div>

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