# Can I apply index template to two index

**URL:** <https://discuss.elastic.co/t/can-i-apply-index-template-to-two-index/353747>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [February 21, 2024, 6:26am UTC](https://discuss.elastic.co/t/can-i-apply-index-template-to-two-index/353747 "2024-02-21T06:26:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frances\_Chu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/frances_chu/32/127298_2.png) [@Frances\_Chu](https://discuss.elastic.co/u/Frances_Chu)\
**Post date:** [February 21, 2024, 6:26am UTC](https://discuss.elastic.co/t/can-i-apply-index-template-to-two-index/353747/1 "2024-02-21T06:26:14Z")

</div>

I create a ilm policy, then index template\_A  
Can I apply the index template\_A to two different index. e.g index\_A\* and index\_B\*.  
If yes how to set the rollover\_alias in the template's setting?

# ============================================= { "index": { "lifecycle": { "name": "plan\_a\_policy", "rollover\_alias": "index\_A" } } }

Or I need to create template per index?

my index like these  
index\_A\_yyyy.mm.dd  
index\_B\_yyyy.mm.dd

---

<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 20, 2024, 6:26am UTC](https://discuss.elastic.co/t/can-i-apply-index-template-to-two-index/353747/2 "2024-03-20T06:26:46Z")

</div>

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