# Index alias with wildcard?

**URL:** https://discuss.elastic.co/t/index-alias-with-wildcard/247026
**Category:** Elasticsearch
**Created:** [August 31, 2020, 11:49pm UTC](https://discuss.elastic.co/t/index-alias-with-wildcard/247026 "2020-08-31T23:49:25Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![AClerk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aclerk/32/55297_2.png) [@AClerk](https://discuss.elastic.co/u/AClerk)
#### Post date: [August 31, 2020, 11:49pm UTC](https://discuss.elastic.co/t/index-alias-with-wildcard/247026/1 "2020-08-31T23:49:25Z")

</div>

Hello,  
I am creating a daily index. Indices look like the following  
my-index-2020-08-31  
my-index-2020-08-30  
my-index-2020-08-29  
my-index-yyyy-mm-dd

Is t possible to add to the template an index alias with wildcard?  
I want, for example, change the order of the naming.  
my-index-2020-08-31 --\> index-my-2020-08-31  
my-index-2020-08-30 --\> index-my-2020-08-30  
my-index-yyyy-mm-dd --\> index-my-yyyy-mm-dd

Something like

```auto
PUT _template/my-index-template
{
    "index_patterns" : [
      "my-index-*"
    ],
    "settings" : {
      "index" : {
        "lifecycle" : {
          "name" : "ilm-1"
        },
        "number_of_shards" : "1",
        "number_of_replicas" : "1"
      }
    },
    "mappings" : {
      "_source" : {
        "enabled" : true
      },
      "properties" : {}
    },
    "aliases" : { 
	"index-my*" {}
	}
}	

```

Or how can I manage this?

Thanks!

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [September 1, 2020, 1:16am UTC](https://discuss.elastic.co/t/index-alias-with-wildcard/247026/2 "2020-09-01T01:16:08Z")

</div>

You can't do that mapping with a template, no.

Is there a reason you can't just rename the index?

---

<div class="post-metadata">

### Author: ![AClerk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aclerk/32/55297_2.png) [@AClerk](https://discuss.elastic.co/u/AClerk)
#### Post date: [September 1, 2020, 2:12am UTC](https://discuss.elastic.co/t/index-alias-with-wildcard/247026/3 "2020-09-01T02:12:49Z")

</div>

All visualisations (and other objects) are based on the original name. I'll have to update all visualisations. dashboards, ml-jobs, etc. to be based on the new naming convention.  
It's a lot of work... trying to find shortcuts, or workarounds.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [September 1, 2020, 6:10am UTC](https://discuss.elastic.co/t/index-alias-with-wildcard/247026/4 "2020-09-01T06:10:21Z")

</div>

Ah ok, fair point.

You could export all your Kibana assets and then open the `export.json` in a text editor and do a find and replace?

---

<div class="post-metadata">

### Author: ![AClerk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aclerk/32/55297_2.png) [@AClerk](https://discuss.elastic.co/u/AClerk)
#### Post date: [September 1, 2020, 6:32am UTC](https://discuss.elastic.co/t/index-alias-with-wildcard/247026/5 "2020-09-01T06:32:50Z")

</div>

> [@warkolm](#):
>
> export.json

I can try that.  
But from past experience, it will lead to multiple issues in the future.  
This is not a bullet proof solution.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [September 1, 2020, 6:36am UTC](https://discuss.elastic.co/t/index-alias-with-wildcard/247026/6 "2020-09-01T06:36:05Z")

</div>

Yeah it's not sorry to say.

I would suggest creating an issue on the Kibana GitHub repo to highlight this.

---

<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: [September 29, 2020, 6:36am UTC](https://discuss.elastic.co/t/index-alias-with-wildcard/247026/7 "2020-09-29T06:36:24Z")

</div>

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