# Triggering index creation via an index template's alias

**URL:** <https://discuss.elastic.co/t/triggering-index-creation-via-an-index-templates-alias/171385>\
**Category:** Elasticsearch\
**Created:** [March 7, 2019, 9:13pm UTC](https://discuss.elastic.co/t/triggering-index-creation-via-an-index-templates-alias/171385 "2019-03-07T21:13:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dan-blanchard](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dan-blanchard/32/36941_2.png) [@dan-blanchard](https://discuss.elastic.co/u/dan-blanchard)\
**Post date:** [March 7, 2019, 9:13pm UTC](https://discuss.elastic.co/t/triggering-index-creation-via-an-index-templates-alias/171385/1 "2019-03-07T21:13:12Z")

</div>

We use versioned time-based indices at Parse.ly that are roughly of the form `v1-foo-2019.03.05.20` (`v{version}-{name}-{YYYY}.{MM}.{DD}.{HH}`). Currently, we have a cron job that runs every 30 minutes that creates the next few indices and aliases them without the version (e.g., `foo-2019.03.05.20` is added as an alias for `v1-foo-2019.03.05.20`). Our write path only writes to the version-less alias.

We would really like to use index templates to handle the alias and index creation, but the problem is that since our write path only writes to version-less aliases, the indices will not get created properly, because they will not match the index patterns (which are version-specific).

In the past, having versioned indices has saved us from disaster when we have added fields with the wrong type to our mappings, so we would like to retain this pattern while also eliminating the need for our custom cron job. Is there anything we could do to allow such a setup?

---

<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:** [April 4, 2019, 9:13pm UTC](https://discuss.elastic.co/t/triggering-index-creation-via-an-index-templates-alias/171385/2 "2019-04-04T21:13:16Z")

</div>

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