# Logstash Mutate Split doesn't work

**URL:** https://discuss.elastic.co/t/logstash-mutate-split-doesnt-work/140227
**Category:** Logstash
**Created:** [July 16, 2018, 10:56pm UTC](https://discuss.elastic.co/t/logstash-mutate-split-doesnt-work/140227 "2018-07-16T22:56:44Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![deadPix3l](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/deadpix3l/32/28707_2.png) [@deadPix3l](https://discuss.elastic.co/u/deadPix3l)
#### Post date: [July 16, 2018, 10:56pm UTC](https://discuss.elastic.co/t/logstash-mutate-split-doesnt-work/140227/1 "2018-07-16T22:56:44Z")

</div>

I'm stuck with 6.1.1 and cannot upgrade, sorry if this was known and fixed but ive been searching for hours for a workaround.

using something similar to:

```auto
filter {
   mutate {
      split => { "dottedField" => '.' }
   }
}

```

and a field value like `this.is.a.dotted.string` should produce `["this", "is", "a", "dotted", "string"]`

What it actually produces is `["this.is.a.dotted.string"]` ie. It does convert it into an array, but it doesn't actually split it. So i get string =\> array with original string as only element.

Please Help.

---

<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: [July 16, 2018, 11:57pm UTC](https://discuss.elastic.co/t/logstash-mutate-split-doesnt-work/140227/2 "2018-07-16T23:57:53Z")

</div>

If you run a really simple configuration like this, what do you get?

```
output { stdout { codec => rubydebug } }
input { generator { count => 1 message => '' } }
filter {
    mutate { add_field => { "dottedField"=> "this.is.a.dotted.field" } }
    mutate { split => { "dottedField" => '.' } } 
}

```

In 6.3.1 I get an array with five entries.

Is it possible it started out as an array and you should really be using

```
mutate { split => { "[dottedField][0]" => '.' } }
```

---

<div class="post-metadata">

### Author: ![deadPix3l](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/deadpix3l/32/28707_2.png) [@deadPix3l](https://discuss.elastic.co/u/deadPix3l)
#### Post date: [July 17, 2018, 5:44pm UTC](https://discuss.elastic.co/t/logstash-mutate-split-doesnt-work/140227/3 "2018-07-17T17:44:22Z")

</div>

Wow. Somehow i missed that.

Kibana shows arrays as comma seperated. only 1 element == no commas == looks like a string.  
But the ES API returns a json array. AHA!

This fixed it, Thank You! (and so timely too!)

---

<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: [August 14, 2018, 5:44pm UTC](https://discuss.elastic.co/t/logstash-mutate-split-doesnt-work/140227/4 "2018-08-14T17:44:37Z")

</div>

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