# String split

**URL:** https://discuss.elastic.co/t/string-split/108117
**Category:** Logstash
**Created:** [November 17, 2017, 11:05am UTC](https://discuss.elastic.co/t/string-split/108117 "2017-11-17T11:05:17Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Shekhar\_Pandey](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@Shekhar\_Pandey](https://discuss.elastic.co/u/Shekhar_Pandey)
#### Post date: [November 17, 2017, 11:05am UTC](https://discuss.elastic.co/t/string-split/108117/1 "2017-11-17T11:05:17Z")

</div>

I use the following syntax to split a string...but its not working...

filter {  
split {  
field =\> ["title"," "]  
}  
}

But its not working......I want to split a string and want to store as a list.  
For example: He is a boy  
splitdata[  
He,  
is,  
a,  
boy  
]

Any idea...about this....Thanks

---

<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: [November 17, 2017, 12:06pm UTC](https://discuss.elastic.co/t/string-split/108117/2 "2017-11-17T12:06:57Z")

</div>

The split filter splits a single event into multiple events which isn't what you're looking for. Use a mutate filter and its split option instead.

---

<div class="post-metadata">

### Author: ![Shekhar\_Pandey](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@Shekhar\_Pandey](https://discuss.elastic.co/u/Shekhar_Pandey)
#### Post date: [November 18, 2017, 1:22pm UTC](https://discuss.elastic.co/t/string-split/108117/3 "2017-11-18T13:22:02Z")

</div>

Solved problem...Thanks. For any person who will search..same question can follow the below methods to split a string...like this..

filter {  
mutate {  
split =\> { "fieldname" =\> " " }  
}  
}

---

<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: [December 16, 2017, 1:22pm UTC](https://discuss.elastic.co/t/string-split/108117/4 "2017-12-16T13:22:08Z")

</div>

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