# Possible to add to @metadata?

**URL:** https://discuss.elastic.co/t/possible-to-add-to-metadata/42592
**Category:** Beats
**Tags:** filebeat
**Created:** [February 24, 2016, 1:41pm UTC](https://discuss.elastic.co/t/possible-to-add-to-metadata/42592 "2016-02-24T13:41:03Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![whitej](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/whitej/32/8028_2.png) [@whitej](https://discuss.elastic.co/u/whitej)
#### Post date: [February 24, 2016, 1:41pm UTC](https://discuss.elastic.co/t/possible-to-add-to-metadata/42592/1 "2016-02-24T13:41:03Z")

</div>

Is it possible to add information to the @metadata field? Or perhaps there's a better way to accomplish what I'm trying to do.

I have multiple prospectors set up on each machine. Each prospector is consuming logs from specific applications of the system. On each prospector, I've configured the document\_type to describe the log file I'm consuming. They are basically named like this: "muffin\_debuglog", "biscuit\_debuglog", "jelly\_debuglog", etc. My logstash output is sending all these into one index since my output is straight out of the example documentation:  
`output { elasticsearch { hosts => "localhost:9200" manage_template => false index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}" document_type => "%{[@metadata][type]}" } }`

My thinking was that I could do something like this: `index => "%{[@metadata][beat]}-%{[@metadata][application_name]}-%{+YYYY.MM.dd}"`

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [February 24, 2016, 1:42pm UTC](https://discuss.elastic.co/t/possible-to-add-to-metadata/42592/2 "2016-02-24T13:42:42Z")

</div>

The `fields` option in the Filebeat configuration can be used to add arbitrary additional fields to events.

---

<div class="post-metadata">

### Author: ![whitej](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/whitej/32/8028_2.png) [@whitej](https://discuss.elastic.co/u/whitej)
#### Post date: [February 24, 2016, 1:44pm UTC](https://discuss.elastic.co/t/possible-to-add-to-metadata/42592/3 "2016-02-24T13:44:59Z")

</div>

I saw that in the configuration and thought "maybe this is the way to go". So I would add a fields: declaration to my filebeat yaml. Easy. In the output section of the Logstash configuration, would it just be something like %{[fields][application\_name]}?

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [February 24, 2016, 1:47pm UTC](https://discuss.elastic.co/t/possible-to-add-to-metadata/42592/4 "2016-02-24T13:47:55Z")

</div>

Something like that, obviously depending on the actual name of the field.

---

<div class="post-metadata">

### Author: ![whitej](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/whitej/32/8028_2.png) [@whitej](https://discuss.elastic.co/u/whitej)
#### Post date: [February 24, 2016, 1:49pm UTC](https://discuss.elastic.co/t/possible-to-add-to-metadata/42592/5 "2016-02-24T13:49:24Z")

</div>

Excellent. Thank you for the assist. Gonna go give this a go. What's the worst that could possibly happen, right? 🙂

---

<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 5, 2017, 9:55pm UTC](https://discuss.elastic.co/t/possible-to-add-to-metadata/42592/6 "2017-07-05T21:55:27Z")

</div>


