# Create an alias from index template

**URL:** <https://discuss.elastic.co/t/create-an-alias-from-index-template/170940>\
**Category:** Elasticsearch\
**Created:** [March 5, 2019, 3:14pm UTC](https://discuss.elastic.co/t/create-an-alias-from-index-template/170940 "2019-03-05T15:14:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![WassimDhib](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wassimdhib/32/43786_2.png) [@WassimDhib](https://discuss.elastic.co/u/WassimDhib)\
**Post date:** [March 5, 2019, 3:14pm UTC](https://discuss.elastic.co/t/create-an-alias-from-index-template/170940/1 "2019-03-05T15:14:37Z")

</div>

Hi,

I have a cluster that receives data from multiple applications

- Data contains fields like "service.name", for example service.app1 and service.app2

- Data for application app1 must go in index named data-app1-yyyy-mm-dd and data for application app2 must go in index named data-app2-yyyy-mm-dd

I want to create an alias with a dynamic name based on a the field "service.name", so that indices data-app1-yyyy-mm-dd get an alias named app1 and so ...

Is it possible to do that in index template with some placeholders ... ?

I know we can do it for a known application name by adding this to index-template

```
  "aliases" : {
        "app1" : {
            "filter" : {
                "term" : { "service.name" : "app1" }
            }
        } 
   }

```

but I do not know all the applications in advance

---

<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 2, 2019, 3:14pm UTC](https://discuss.elastic.co/t/create-an-alias-from-index-template/170940/2 "2019-04-02T15:14:39Z")

</div>

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