# Beats - Define field type with add\_fields processor in \*beat.yml?

**URL:** <https://discuss.elastic.co/t/beats-define-field-type-with-add-fields-processor-in-beat-yml/219385>\
**Category:** Beats\
**Created:** [February 14, 2020, 2:34pm UTC](https://discuss.elastic.co/t/beats-define-field-type-with-add-fields-processor-in-beat-yml/219385 "2020-02-14T14:34:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![devbot](https://avatars.discourse-cdn.com/v4/letter/d/9de0a6/32.png) [@devbot](https://discuss.elastic.co/u/devbot)\
**Post date:** [February 14, 2020, 2:34pm UTC](https://discuss.elastic.co/t/beats-define-field-type-with-add-fields-processor-in-beat-yml/219385/1 "2020-02-14T14:34:09Z")

</div>

Looking at [this](https://www.elastic.co/guide/en/beats/filebeat/7.4/add-fields.html) documentation on adding fields, I see that filebeat can add any custom field by name and value that will be appended to every documented pushed to Elasticsearch by Filebeat.

This is defined in filebeat.yml:

```auto
processors:
- add_fields:
    target: project
    fields:
      name: myproject
      id: '574734885120952459'

```

Is there a way, strictly from filebeat.yml, to give fields added here a "type" as well? For example, can I assign "name" to type "keyword" ?

---

<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:** [February 19, 2020, 2:10pm UTC](https://discuss.elastic.co/t/beats-define-field-type-with-add-fields-processor-in-beat-yml/219385/2 "2020-02-19T14:10:13Z")

</div>

Yes, you can use the `setup.template.append_fields` setting in `filebeat.yml`. See the documentation and example for this setting on [https://www.elastic.co/guide/en/beats/filebeat/current/configuration-template.html](https://www.elastic.co/guide/en/beats/filebeat/current/configuration-template.html).

---

<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:** [March 18, 2020, 4:10pm UTC](https://discuss.elastic.co/t/beats-define-field-type-with-add-fields-processor-in-beat-yml/219385/3 "2020-03-18T16:10:13Z")

</div>

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