# Split filebeat name

**URL:** <https://discuss.elastic.co/t/split-filebeat-name/183419>\
**Category:** Logstash\
**Created:** [May 29, 2019, 8:17pm UTC](https://discuss.elastic.co/t/split-filebeat-name/183419 "2019-05-29T20:17:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zareh42](https://avatars.discourse-cdn.com/v4/letter/z/ba8739/32.png) [@Zareh42](https://discuss.elastic.co/u/Zareh42)\
**Post date:** [May 29, 2019, 8:17pm UTC](https://discuss.elastic.co/t/split-filebeat-name/183419/1 "2019-05-29T20:17:29Z")

</div>

I am trying to implement the filter below. And continue to get an error about

```
Invalid FieldReference: `%{[beat][hostname]}`

```

I believe I am calling the field correctly based on the guide [here](https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#logstash-config-field-references)

```
filter {
        mutate {
        split => ["%{[beat][hostname]}", "." ]
        add_field => { "test_shortname" => "%{[beat][hostname][0]}" }
    }  
}

```

I recently started working on this recently so I am still very new to elastic

---

<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:** [May 29, 2019, 8:44pm UTC](https://discuss.elastic.co/t/split-filebeat-name/183419/2 "2019-05-29T20:44:30Z")

</div>

You cannot use a sprintf reference in the split option like that. Try

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

---

<div class="post-metadata">

**Author:** ![Zareh42](https://avatars.discourse-cdn.com/v4/letter/z/ba8739/32.png) [@Zareh42](https://discuss.elastic.co/u/Zareh42)\
**Post date:** [May 29, 2019, 8:50pm UTC](https://discuss.elastic.co/t/split-filebeat-name/183419/3 "2019-05-29T20:50:20Z")

</div>

Thank you that worked. Really appreciate it, I must have missed that somewhere in the documentation.

---

<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 26, 2019, 8:50pm UTC](https://discuss.elastic.co/t/split-filebeat-name/183419/4 "2019-06-26T20:50:21Z")

</div>

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