# Adding conditional tags or fields in filebeat.yml

**URL:** https://discuss.elastic.co/t/adding-conditional-tags-or-fields-in-filebeat-yml/79952
**Category:** Beats
**Tags:** filebeat
**Created:** [March 24, 2017, 9:35pm UTC](https://discuss.elastic.co/t/adding-conditional-tags-or-fields-in-filebeat-yml/79952 "2017-03-24T21:35:57Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![vramakrishnan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vramakrishnan/32/31750_2.png) [@vramakrishnan](https://discuss.elastic.co/u/vramakrishnan)
#### Post date: [March 24, 2017, 9:35pm UTC](https://discuss.elastic.co/t/adding-conditional-tags-or-fields-in-filebeat-yml/79952/1 "2017-03-24T21:35:57Z")

</div>

A) Is there a way to add tags or fields - conditionally in filebeat.

For eg: if the input file is _xyz_ then add tag or field XYZ  
if the input file is _abc_ then add tag or field ABC

OR

b) Alternatively can we add tag/field per prospector path ?

- input\_type: log

- input\_type: log

---

<div class="post-metadata">

### Author: ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)
#### Post date: [March 27, 2017, 8:23am UTC](https://discuss.elastic.co/t/adding-conditional-tags-or-fields-in-filebeat-yml/79952/2 "2017-03-27T08:23:39Z")

</div>

You can use multiple prospectors for that. Each prospector can have it's own fields / tags.

---

<div class="post-metadata">

### Author: ![vramakrishnan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vramakrishnan/32/31750_2.png) [@vramakrishnan](https://discuss.elastic.co/u/vramakrishnan)
#### Post date: [March 27, 2017, 3:33pm UTC](https://discuss.elastic.co/t/adding-conditional-tags-or-fields-in-filebeat-yml/79952/3 "2017-03-27T15:33:18Z")

</div>

Thanks that worked. Appreciate it.

---

<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: [April 24, 2017, 3:33pm UTC](https://discuss.elastic.co/t/adding-conditional-tags-or-fields-in-filebeat-yml/79952/4 "2017-04-24T15:33:21Z")

</div>

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