# Logstash split String

**URL:** https://discuss.elastic.co/t/logstash-split-string/84946
**Category:** Logstash
**Created:** [May 8, 2017, 2:39pm UTC](https://discuss.elastic.co/t/logstash-split-string/84946 "2017-05-08T14:39:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Thomas-cc](https://avatars.discourse-cdn.com/v4/letter/t/d6d6ee/32.png) [@Thomas-cc](https://discuss.elastic.co/u/Thomas-cc)
#### Post date: [May 8, 2017, 2:39pm UTC](https://discuss.elastic.co/t/logstash-split-string/84946/1 "2017-05-08T14:39:54Z")

</div>

Hallo all togehter,

i have build a new instance with icinga-beat-\>logstash-\>elasticsearch-\>kibana (all with the newest version)

Everything works fine, but i have a litte problem with split one string to an array.

The variable in want to split is "check\_result.output" and an sample Output in Kibana would be "c:\ - total: 59.66 Gb - used: 47.92 Gb (80%) - free 11.73 Gb (20%) ". So now i want to split these string to an array (seperator should be "-")

I build up a new logstash.conf file with this filter:

filter {  
mutate{  
split =\> ["check\_result.output", "-"]  
add\_field =\> {  
"event" =\> "%{check\_result.output[0]}"  
"eventSource" =\> "%{check\_result.output[2]}"  
}  
}

The new fileds get generated in the Kibana Dashboard, but the values from the array are not visible, it just shows: %{check\_result.output[0]}

---

<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: [May 8, 2017, 2:47pm UTC](https://discuss.elastic.co/t/logstash-split-string/84946/2 "2017-05-08T14:47:07Z")

</div>

The syntax for how the reference nested fields is described here: [https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#logstash-config-field-references](https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#logstash-config-field-references)

---

<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: [June 6, 2017, 7:31am UTC](https://discuss.elastic.co/t/logstash-split-string/84946/4 "2017-06-06T07:31:43Z")

</div>

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