title: Elasticsearch Opendistro ISM: What approach can be taken to apply the rollover alias and policy to new indices, automatically?
body: <p>When ISM policies are used, the index policy settings need to be applied during index creation but those settings are lost once a new index is created from the rollover action applied by a certain stage/phase in the policy.</p>
  
  <p>For instance, having indices in the form: </p>
  
  <pre><code>pattern:        msp-*          [* =&gt; number, in the index template]
  alias:          msp-*-alias    [applied during the index creation]
  rollover alias: msp-*-alias
  policy:         msp-policy-id
  </code></pre>
  
  <p>Having a template index pattern <code>msp-*</code> (where * is a number) impedes having a rollover alias msp-*-alias for each value that * can take applied automatically. How could this situation be approached?</p>
  
  <p><strong>References:</strong></p>
  
  <p><a href="https://stackoverflow.com/questions/36288714/can-variables-be-used-in-elasticsearch-index-templates#">Can variables be used in elasticsearch index templates?</a></p>
  
  <p><a href="https://discuss.elastic.co/t/index-lifecycle-management-dynamic-rollover-alias-and-template-name/169614" rel="nofollow noreferrer">https://discuss.elastic.co/t/index-lifecycle-management-dynamic-rollover-alias-and-template-name/169614</a></p>
  
  <p><a href="https://github.com/elastic/elasticsearch/issues/20367" rel="nofollow noreferrer">https://github.com/elastic/elasticsearch/issues/20367</a></p>
  
  <p><a href="https://github.com/opendistro-for-elasticsearch/index-management/issues/95" rel="nofollow noreferrer">https://github.com/opendistro-for-elasticsearch/index-management/issues/95</a></p>
  
  <p><a href="https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/ism.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/ism.html</a></p>