# Same index pattern but different index template

**URL:** <https://discuss.elastic.co/t/same-index-pattern-but-different-index-template/342018>\
**Category:** Elasticsearch\
**Created:** [August 31, 2023, 6:48am UTC](https://discuss.elastic.co/t/same-index-pattern-but-different-index-template/342018 "2023-08-31T06:48:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cruz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cruz/32/116126_2.png) [@Cruz](https://discuss.elastic.co/u/Cruz)\
**Post date:** [August 31, 2023, 6:48am UTC](https://discuss.elastic.co/t/same-index-pattern-but-different-index-template/342018/1 "2023-08-31T06:48:51Z")

</div>

Good day!

I just have a question regarding on `Index Template`  
is it possible to create a different index template but same index pattern?

What I am going to do is to create a `index template` but same name on the `index pattern` on my existing `index template`.

I have new test server and I just installed beats on there, I just want to shipped the logs on the existing data stream. So, that I can avoid creating new data stream and indices

---

<div class="post-metadata">

**Author:** ![chouben](https://avatars.discourse-cdn.com/v4/letter/c/e495f1/32.png) [@chouben](https://discuss.elastic.co/u/chouben)\
**Post date:** [August 31, 2023, 9:25am UTC](https://discuss.elastic.co/t/same-index-pattern-but-different-index-template/342018/2 "2023-08-31T09:25:56Z")

</div>

Index templates have priority. As the interface shows, only the highest priority will be applied:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/2/5239514d5a2471c128403e1d2eae146a51f07bf2.png)

---

<div class="post-metadata">

**Author:** ![Cruz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cruz/32/116126_2.png) [@Cruz](https://discuss.elastic.co/u/Cruz)\
**Post date:** [September 3, 2023, 12:35pm UTC](https://discuss.elastic.co/t/same-index-pattern-but-different-index-template/342018/3 "2023-09-03T12:35:03Z")

</div>

Hi @chouben thank you for your kind response.

is this option for Kibana API?  
What about when you load your index template using logstash?  
Does it mean, it cannot install because of the priority settings?

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [September 3, 2023, 2:30pm UTC](https://discuss.elastic.co/t/same-index-pattern-but-different-index-template/342018/4 "2023-09-03T14:30:18Z")

</div>

You can specify the `priority` in the body of the template as explained in the [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-template.html#indices-put-template).

Bu it is not clear what you want to do, if you have two templates for the same index pattern, the template with the highest priority will be applied and will override settings in the template with the lower priority.

Is this what you want?

---

<div class="post-metadata">

**Author:** ![Cruz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cruz/32/116126_2.png) [@Cruz](https://discuss.elastic.co/u/Cruz)\
**Post date:** [September 3, 2023, 10:47pm UTC](https://discuss.elastic.co/t/same-index-pattern-but-different-index-template/342018/5 "2023-09-03T22:47:47Z")

</div>

I have 2 beats installed on different servers (filebeat, winlogbeat)

What I want to do when I create an index template for the beats I want them to have the same data stream name because I have an existing data stream.

I don't want to create another data stream when creating a new Index template.

is that possible?

Thank you @leandrojmp for your response.  
Appreciate it.

---

<div class="post-metadata">

**Author:** ![chouben](https://avatars.discourse-cdn.com/v4/letter/c/e495f1/32.png) [@chouben](https://discuss.elastic.co/u/chouben)\
**Post date:** [September 4, 2023, 11:24am UTC](https://discuss.elastic.co/t/same-index-pattern-but-different-index-template/342018/6 "2023-09-04T11:24:33Z")

</div>

So you have multiple steps:

1. Configure the index pattern in your beats, make them all point to the same pattern  
E.g. [Filbeat docs](https://www.elastic.co/guide/en/beats/filebeat/current/logstash-output.html)
2. Configure the index templates (with highest priority) to match your index pattern in elasticsearch (can be done via Kibana), so you got control for e.g. datastream, ILM, replication, ...

Good luck!

---

<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:** [October 2, 2023, 11:25am UTC](https://discuss.elastic.co/t/same-index-pattern-but-different-index-template/342018/7 "2023-10-02T11:25:13Z")

</div>

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