# Filebeat Configuration: Adding fields in filebeat.yml

**URL:** https://discuss.elastic.co/t/filebeat-configuration-adding-fields-in-filebeat-yml/203617
**Category:** Beats
**Tags:** filebeat
**Created:** [October 15, 2019, 10:17am UTC](https://discuss.elastic.co/t/filebeat-configuration-adding-fields-in-filebeat-yml/203617 "2019-10-15T10:17:30Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![souravatta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/souravatta/32/61388_2.png) [@souravatta](https://discuss.elastic.co/u/souravatta)
#### Post date: [October 15, 2019, 10:17am UTC](https://discuss.elastic.co/t/filebeat-configuration-adding-fields-in-filebeat-yml/203617/1 "2019-10-15T10:17:30Z")

</div>

I need to write a filebeat.yml for reading jenkins logs and then stashing the same in ELK.  
I have come across this filter and want to implement the same in filebeat.yml. I have made changes accordingly but stuck here in the add\_fields part of this filter plugin.

Can anyone help me in adding fields in filbeat.yml similar to the add\_field in this filter plugin?

 ![filter_plugin](https://us1.discourse-cdn.com/elastic/original/3X/6/3/63929b8a59b6e44d883d9cf1837e2654dfb31dfc.jpeg)

Filebeat.yml

```
#=========================== Filebeat inputs =============================

filebeat.inputs:
- type: log
  enabled: true
  paths:
   - /opt/app/elk/logs/jenkins.log 
  multiline.pattern: '^%{MONTH} %{MONTHDAY}, %{YEAR} %{TIME} (AM|PM)'
  multiline.negate: true
  multiline.match: before
```

---

<div class="post-metadata">

### Author: ![shaunak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaunak/32/6643_2.png) [@shaunak](https://discuss.elastic.co/u/shaunak)
#### Post date: [October 15, 2019, 10:38pm UTC](https://discuss.elastic.co/t/filebeat-configuration-adding-fields-in-filebeat-yml/203617/2 "2019-10-15T22:38:22Z")

</div>

You could use the [`add_fields` processor](https://www.elastic.co/guide/en/beats/filebeat/current/add-fields.html) in Filebeat to add these fields.

All processors [accept](https://www.elastic.co/guide/en/beats/filebeat/current/defining-processors.html) an optional `when` field that can be used to specify the conditions under which the processor is to be executed.

---

<div class="post-metadata">

### Author: ![souravatta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/souravatta/32/61388_2.png) [@souravatta](https://discuss.elastic.co/u/souravatta)
#### Post date: [October 16, 2019, 5:08am UTC](https://discuss.elastic.co/t/filebeat-configuration-adding-fields-in-filebeat-yml/203617/3 "2019-10-16T05:08:49Z")

</div>

Hi @shaunak

Thank you for the solution.  
Sorry, but i didn't understand the example given in this [add\_fields processor](https://www.elastic.co/guide/en/beats/filebeat/current/add-fields.html).  
Could you please help me to add the add\_fields in filebeat.yml given above ? 🙂

---

<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 13, 2019, 5:08am UTC](https://discuss.elastic.co/t/filebeat-configuration-adding-fields-in-filebeat-yml/203617/4 "2019-11-13T05:08:53Z")

</div>

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