# Use of filebeat templates - single template vs multiple templates

**URL:** <https://discuss.elastic.co/t/use-of-filebeat-templates-single-template-vs-multiple-templates/222437>\
**Category:** Logstash\
**Created:** [March 6, 2020, 10:07am UTC](https://discuss.elastic.co/t/use-of-filebeat-templates-single-template-vs-multiple-templates/222437 "2020-03-06T10:07:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mvienne](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@mvienne](https://discuss.elastic.co/u/mvienne)\
**Post date:** [March 6, 2020, 10:07am UTC](https://discuss.elastic.co/t/use-of-filebeat-templates-single-template-vs-multiple-templates/222437/1 "2020-03-06T10:07:15Z")

</div>

I'm confused about the use of filebeat templates with the file `fields.yml`.

If I want to store two types of logs into elasticsearch, let's say apache logs and postgres logs, is it better to have a single template in the file `fields.yml`, or should I instead use multiple templates (logstash-6.2.3-apache\* and logstash-6.2.3-postgres\*)?

- If I chose the former, is it really a good practice to merge the definition of unrelated fields into a single template?
- If I chose the latter, am I supposed to setup my templates manually in elasticsearch with `PUT _template/logstash-6.2.3-apache` for example?

---

<div class="post-metadata">

**Author:** ![mvienne](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@mvienne](https://discuss.elastic.co/u/mvienne)\
**Post date:** [March 6, 2020, 10:27am UTC](https://discuss.elastic.co/t/use-of-filebeat-templates-single-template-vs-multiple-templates/222437/2 "2020-03-06T10:27:35Z")

</div>

I want to define my own templates, because I want to store logs other than apache and postgres which don't have modules available

---

<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 3, 2020, 10:27am UTC](https://discuss.elastic.co/t/use-of-filebeat-templates-single-template-vs-multiple-templates/222437/3 "2020-04-03T10:27:41Z")

</div>

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