# How does the dynamic typing work in filebeat

**URL:** <https://discuss.elastic.co/t/how-does-the-dynamic-typing-work-in-filebeat/44569>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [March 16, 2016, 2:59pm UTC](https://discuss.elastic.co/t/how-does-the-dynamic-typing-work-in-filebeat/44569 "2016-03-16T14:59:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jclose](https://avatars.discourse-cdn.com/v4/letter/j/df705f/32.png) [@jclose](https://discuss.elastic.co/u/jclose)\
**Post date:** [March 16, 2016, 2:59pm UTC](https://discuss.elastic.co/t/how-does-the-dynamic-typing-work-in-filebeat/44569/1 "2016-03-16T14:59:27Z")

</div>

We are looking to send a plethora of different logs into a downstream logstash cluster.

How exactly does the type setting work within filebeat, so that I can appropriately tag incoming data in logstash in order to grok the info properly [for parsing]?

The template file shows "type": "{dynamic\_type}", but I can't find an explanation of what that means.

Is there a best practice for being able to easily add a type on the logstash side (via the beats input) so that I can easily direct to filter to the right grok?

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [March 17, 2016, 2:41pm UTC](https://discuss.elastic.co/t/how-does-the-dynamic-typing-work-in-filebeat/44569/2 "2016-03-17T14:41:39Z")

</div>

> [@jclose](#):
>
> How exactly does the type setting work within filebeat

You can override the `type` field using Filebeat config by using [`document_type`](https://www.elastic.co/guide/en/beats/filebeat/current/configuration-filebeat-options.html#_document_type). By default the value is "log".

> [@jclose](#):
>
> The template file shows "type": "{dynamic\_type}", but I can't find an explanation of what that means.

The template file is for the Elasticsearch index template. You can read more about the format [here](https://www.elastic.co/guide/en/elasticsearch/reference/2.2/dynamic-templates.html#template-variables). Most users have no need to modify this.

I think what you are asking is how can you add additional data to the events so that you can setup conditional processing in Logstash. For this you have multiple options.

- [fields](https://www.elastic.co/guide/en/beats/filebeat/current/configuration-filebeat-options.html#configuration-fields)
- [fields\_under\_root](https://www.elastic.co/guide/en/beats/filebeat/current/configuration-filebeat-options.html#fields-under-root)
- [tags](https://www.elastic.co/guide/en/beats/filebeat/current/configuration-shipper.html#_tags) - these can only be set at the global level now, but in v1.2 and v5 you can set tags as an option under prospector. See examples [here](https://github.com/elastic/beats/pull/1092)
- [document\_type](https://www.elastic.co/guide/en/beats/filebeat/current/configuration-filebeat-options.html#_document_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 5, 2017, 9:54pm UTC](https://discuss.elastic.co/t/how-does-the-dynamic-typing-work-in-filebeat/44569/3 "2017-07-05T21:54:35Z")

</div>


