# Ambiguous in documentation which describe logstash filter plugin "mutate -\> split"

**URL:** https://discuss.elastic.co/t/ambiguous-in-documentation-which-describe-logstash-filter-plugin-mutate-split/166086
**Category:** Logstash
**Created:** [January 29, 2019, 5:21am UTC](https://discuss.elastic.co/t/ambiguous-in-documentation-which-describe-logstash-filter-plugin-mutate-split/166086 "2019-01-29T05:21:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![royoan](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@royoan](https://discuss.elastic.co/u/royoan)
#### Post date: [January 29, 2019, 5:21am UTC](https://discuss.elastic.co/t/ambiguous-in-documentation-which-describe-logstash-filter-plugin-mutate-split/166086/1 "2019-01-29T05:21:44Z")

</div>

In the page :  
[https://www.elastic.co/guide/en/logstash/current/plugins-filters-mutate.html#plugins-filters-mutate-split](https://www.elastic.co/guide/en/logstash/current/plugins-filters-mutate.html#plugins-filters-mutate-split)

In the "Describtion" section,it show the field "split" type as an array.  
filter {  
mutate {  
split =\> ["hostname", "."]  
add\_field =\> { "shortHostname" =\> "%{hostname[0]}" }  
}

But in the "split" section, it is described as an hash type.

#### `split`

- Value type is hash
- There is no default value for this setting.

Split a field to an array using a separator character. Only works on string fields.

Example:

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

It's not good for a fresh hand.

---

<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: [January 29, 2019, 1:21pm UTC](https://discuss.elastic.co/t/ambiguous-in-documentation-which-describe-logstash-filter-plugin-mutate-split/166086/2 "2019-01-29T13:21:27Z")

</div>

I agree this can seem confusing, but the truth is either one will work. If you supply an array it is used as if it were a hash.

---

<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: [February 26, 2019, 1:21pm UTC](https://discuss.elastic.co/t/ambiguous-in-documentation-which-describe-logstash-filter-plugin-mutate-split/166086/3 "2019-02-26T13:21:28Z")

</div>

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