Setting Rollover Alias for Multiple Indices Under a Single Template

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:

{
  "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!

As far as I know this is not possible.

1 Like

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.

2 Likes

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

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