# Setting Rollover Alias for Multiple Indices Under a Single Template

**URL:** <https://discuss.elastic.co/t/setting-rollover-alias-for-multiple-indices-under-a-single-template/355235>\
**Category:** Elasticsearch\
**Created:** [March 12, 2024, 2:16pm UTC](https://discuss.elastic.co/t/setting-rollover-alias-for-multiple-indices-under-a-single-template/355235 "2024-03-12T14:16:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![saisimo01](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@saisimo01](https://discuss.elastic.co/u/saisimo01)\
**Post date:** [March 12, 2024, 2:16pm UTC](https://discuss.elastic.co/t/setting-rollover-alias-for-multiple-indices-under-a-single-template/355235/1 "2024-03-12T14:16:13Z")

</div>

Hello Elastic Community,

I am currently managing multiple Elastic indices formatted like `es-project1-app1`, `es-project1-app2`,... `es-project2-app1`, `es-project2-app2`, etc., across various projects. At the moment, it seems I must create a separate template for each index to define its `rollover_alias`. This approach is quite cumbersome, and I'm seeking a more streamlined solution.

Is there a way to define a single template per project and apply a specific `rollover_alias` for each index? Ideally, I would like to avoid having a separate template for every index while still being able to assign a unique `rollover_alias` to each.  
For context, here is the current setting for the template of `es-project1-app1`:

```auto
{
  "index": {
    "lifecycle": {
      "name": "elk-ilm-weekly",
      "rollover_alias": "es-project1-app1-alias"
    }
  }
}

```

Could anyone guide me on how to configure a template that can apply to multiple indices while allowing for a unique `rollover_alias` per index? Any advice or examples would be greatly appreciated.

Thank you in advance for your help!

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [March 24, 2024, 8:25am UTC](https://discuss.elastic.co/t/setting-rollover-alias-for-multiple-indices-under-a-single-template/355235/2 "2024-03-24T08:25:39Z")

</div>

> [@saisimo01](#):
>
> Could anyone guide me on how to configure a template that can apply to multiple indices while allowing for a unique `rollover_alias` per index? Any advice or examples would be greatly appreciated.

As far as I know this is not possible.

---

<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:** [March 24, 2024, 4:17pm UTC](https://discuss.elastic.co/t/setting-rollover-alias-for-multiple-indices-under-a-single-template/355235/3 "2024-03-24T16:17:47Z")

</div>

> [@saisimo01](#):
>
> Could anyone guide me on how to configure a template that can apply to multiple indices while allowing for a unique `rollover_alias` per index?

This is not possible, you will need a template per index.

What you can do if you have common settings and mappings is to have the mappings and common settings on a component template, and then in the index template you woudl need to set just the rollover\_alias e import the component template.

---

<div class="post-metadata">

**Author:** ![saisimo01](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@saisimo01](https://discuss.elastic.co/u/saisimo01)\
**Post date:** [April 10, 2024, 9:59am UTC](https://discuss.elastic.co/t/setting-rollover-alias-for-multiple-indices-under-a-single-template/355235/4 "2024-04-10T09:59:21Z")

</div>

Yeah for the moment we are already using this strategy... but it would be better to have another solution in the future to avoid managing several index templates.

Thanks all for your feedback

---

<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:** [May 8, 2024, 9:59am UTC](https://discuss.elastic.co/t/setting-rollover-alias-for-multiple-indices-under-a-single-template/355235/5 "2024-05-08T09:59:53Z")

</div>

Closed on May 8, 2024, 9:59am UTC

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