# Documentation error

**URL:** https://discuss.elastic.co/t/documentation-error/253330
**Category:** Logstash
**Created:** [October 26, 2020, 2:57pm UTC](https://discuss.elastic.co/t/documentation-error/253330 "2020-10-26T14:57:31Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![gborg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gborg/32/58934_2.png) [@gborg](https://discuss.elastic.co/u/gborg)
#### Post date: [October 26, 2020, 2:57pm UTC](https://discuss.elastic.co/t/documentation-error/253330/1 "2020-10-26T14:57:31Z")

</div>

In the logstash mutete filter documentation there seems to be an error, or at least it seems like an error to me

```auto
      mutate {
        split => ["hostname", "."]
        add_field => { "shortHostname" => "%{hostname[0]}" }
    }

```

does not work, however this works

```auto
      mutate {
        split => ["hostname", "."]
        add_field => { "shortHostname" => "%{hostname][0]}" }
    }

```

Both the field name and the indexing number need to be in square brackets

> **[Mutate filter plugin | Logstash Reference \[7.9\] | Elastic](https://www.elastic.co/guide/en/logstash/current/plugins-filters-mutate.html#plugins-filters-mutate-add_tag)**

---

<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: [October 26, 2020, 4:39pm UTC](https://discuss.elastic.co/t/documentation-error/253330/2 "2020-10-26T16:39:01Z")

</div>

> [@gborg](#):
>
> it seems like an error to me

Indeed. "%{hostname[0]}" worked up until the 7.0 release, at which point it started to result in an error.

---

<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: [November 23, 2020, 4:39pm UTC](https://discuss.elastic.co/t/documentation-error/253330/3 "2020-11-23T16:39:12Z")

</div>

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