# %{\[@metadata\]\[beat\]} style index in elastic with snmptrap input

**URL:** <https://discuss.elastic.co/t/metadata-beat-style-index-in-elastic-with-snmptrap-input/89579>\
**Category:** Logstash\
**Created:** [June 15, 2017, 2:50pm UTC](https://discuss.elastic.co/t/metadata-beat-style-index-in-elastic-with-snmptrap-input/89579 "2017-06-15T14:50:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lcorsini](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lcorsini/32/19170_2.png) [@lcorsini](https://discuss.elastic.co/u/lcorsini)\
**Post date:** [June 15, 2017, 2:50pm UTC](https://discuss.elastic.co/t/metadata-beat-style-index-in-elastic-with-snmptrap-input/89579/1 "2017-06-15T14:50:26Z")

</div>

Hi,  
I'm experimenting with logstash and the snmptrap input.  
The first problem I'm encountering is how to send them to elasticsearch  
right now I'm using filebeat and icingabeat so, my elasticsearch output creates different indexes based on beat name.  
snmptrap input doesn't work this way, how can I send traps to a specific index in elasticsearch?

---

<div class="post-metadata">

**Author:** ![lcorsini](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lcorsini/32/19170_2.png) [@lcorsini](https://discuss.elastic.co/u/lcorsini)\
**Post date:** [June 15, 2017, 3:24pm UTC](https://discuss.elastic.co/t/metadata-beat-style-index-in-elastic-with-snmptrap-input/89579/2 "2017-06-15T15:24:51Z")

</div>

I solved with something like this for now:

```
 filter {
       if [type] == "snmptrap" {
            mutate { 
                add_field => { "[@metadata][beat]" => "%{type}" }
                add_field => { "[@metadata][type]" => "%{type}" }
            }
       } 
 }
```

---

<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:** [July 13, 2017, 3:24pm UTC](https://discuss.elastic.co/t/metadata-beat-style-index-in-elastic-with-snmptrap-input/89579/3 "2017-07-13T15:24:58Z")

</div>

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