# Rename index in Elasticsearch

**URL:** <https://discuss.elastic.co/t/rename-index-in-elasticsearch/190166>\
**Category:** Elasticsearch\
**Created:** [July 12, 2019, 8:18am UTC](https://discuss.elastic.co/t/rename-index-in-elasticsearch/190166 "2019-07-12T08:18:25Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![smerzlyakov](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@smerzlyakov](https://discuss.elastic.co/u/smerzlyakov)\
**Post date:** [July 12, 2019, 8:18am UTC](https://discuss.elastic.co/t/rename-index-in-elasticsearch/190166/1 "2019-07-12T08:18:25Z")

</div>

Hello.

1. Why it is not possible to do in Kibana? You can delete index, but cannot rename. Will you plan to add this feature?
2. How to rename index in Elasticsearch easilly?

---

<div class="post-metadata">

**Author:** ![harshbajaj16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harshbajaj16/32/44970_2.png) [@harshbajaj16](https://discuss.elastic.co/u/harshbajaj16)\
**Post date:** [July 12, 2019, 9:55am UTC](https://discuss.elastic.co/t/rename-index-in-elasticsearch/190166/2 "2019-07-12T09:55:53Z")

</div>

Hi @smerzlyakov,

I would like to tell you that there is no such process to rename the index in elasticsearch. However if you want to rename you need to reindex the same with new name and for reindex you can use reindex API in elasticsearch.

Please find the reference link for reindex API.  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html)

Regards,  
Harsh Bajaj

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 12, 2019, 10:12am UTC](https://discuss.elastic.co/t/rename-index-in-elasticsearch/190166/3 "2019-07-12T10:12:13Z")

</div>

> How to rename index in Elasticsearch easilly?

Use an index alias. It's not a "rename" as per say but can probably help without needing to reindex.

---

<div class="post-metadata">

**Author:** ![smerzlyakov](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@smerzlyakov](https://discuss.elastic.co/u/smerzlyakov)\
**Post date:** [July 12, 2019, 10:12am UTC](https://discuss.elastic.co/t/rename-index-in-elasticsearch/190166/4 "2019-07-12T10:12:59Z")

</div>

Thank you, Harsh.  
And when i need to rename multiple indexes for this mask, for example:  
filebeat-%{+YYYY.MM.dd}  
And want to do it for two mounth, how must i construct the query?  
POST \_reindex  
{  
"source": {  
"index": "filebeat-2019-mm.dd"  
},  
"dest": {  
"index": "filebeat\_new-2019-mm.dd"  
}  
}

---

<div class="post-metadata">

**Author:** ![smerzlyakov](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@smerzlyakov](https://discuss.elastic.co/u/smerzlyakov)\
**Post date:** [July 12, 2019, 10:17am UTC](https://discuss.elastic.co/t/rename-index-in-elasticsearch/190166/5 "2019-07-12T10:17:07Z")

</div>

Thank you David, but i need to rename it. I want to use previous name for different purpose and it is hard to support future renaming with aliases, i think.  
My case with Elastic is SIEM-like.  
First you get all logs in raw format to ELK. And name it once.  
Than you try to normalise them with ECS.  
And you do it multiple times. You do mistakes in naming, go to some standart for your organisation.  
I think ELK really need the feature with renaming.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 12, 2019, 10:26am UTC](https://discuss.elastic.co/t/rename-index-in-elasticsearch/190166/6 "2019-07-12T10:26:40Z")

</div>

I'd read this: [https://www.elastic.co/fr/blog/migrating-to-elastic-common-schema-in-beats-environments](https://www.elastic.co/fr/blog/migrating-to-elastic-common-schema-in-beats-environments)

---

<div class="post-metadata">

**Author:** ![harshbajaj16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harshbajaj16/32/44970_2.png) [@harshbajaj16](https://discuss.elastic.co/u/harshbajaj16)\
**Post date:** [July 12, 2019, 10:50am UTC](https://discuss.elastic.co/t/rename-index-in-elasticsearch/190166/7 "2019-07-12T10:50:13Z")

</div>

Hi @smerzlyakov,

I didn't understand your requirement. Could you clear bit more about your use case?

> [@smerzlyakov](#):
>
> And want to do it for two mounth, how must i construct the query?

Regards,  
Harsh Bajaj

---

<div class="post-metadata">

**Author:** ![smerzlyakov](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@smerzlyakov](https://discuss.elastic.co/u/smerzlyakov)\
**Post date:** [July 12, 2019, 11:13am UTC](https://discuss.elastic.co/t/rename-index-in-elasticsearch/190166/8 "2019-07-12T11:13:57Z")

</div>

Hi @harshbajaj16,

Just what command it must be to (rename) reindex multiple indexes at once?

---

<div class="post-metadata">

**Author:** ![harshbajaj16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harshbajaj16/32/44970_2.png) [@harshbajaj16](https://discuss.elastic.co/u/harshbajaj16)\
**Post date:** [July 12, 2019, 11:28am UTC](https://discuss.elastic.co/t/rename-index-in-elasticsearch/190166/9 "2019-07-12T11:28:48Z")

</div>

Hi @smerzlyakov,

I don't think so that you can do reindex multiple index in one go.

Regards,  
Harsh Bajaj

---

<div class="post-metadata">

**Author:** ![smerzlyakov](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@smerzlyakov](https://discuss.elastic.co/u/smerzlyakov)\
**Post date:** [July 19, 2019, 9:12am UTC](https://discuss.elastic.co/t/rename-index-in-elasticsearch/190166/10 "2019-07-19T09:12:24Z")

</div>

Hi @Harsh,  
It is defenetly possible to rename multiple indexes in one go. For example multiple to one ([doc](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html)):

```
POST _reindex
{
  "source": {
    "index": ["twitter", "blog"]
  },
  "dest": {
    "index": "all_together"
  }
}

```

But i cant find example for reindexing multiple to multiple. Like [index1,index2] to [new\_index1, new\_index2]

---

<div class="post-metadata">

**Author:** ![harshbajaj16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harshbajaj16/32/44970_2.png) [@harshbajaj16](https://discuss.elastic.co/u/harshbajaj16)\
**Post date:** [July 22, 2019, 4:36am UTC](https://discuss.elastic.co/t/rename-index-in-elasticsearch/190166/11 "2019-07-22T04:36:26Z")

</div>

Hi @smerzlyakov,

I was talking about this scenario only.

> [@](#):
>
> But i cant find example for reindexing multiple to multiple. Like [index1,index2] to [new\_index1, new\_index2]

Yes, it is possible to insert new documents while reindexing your index as you shown above. However, `Like [index1,index2] to [new_index1, new_index2]`not possible.

Regards,  
Harsh Bajaj

---

<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:** [August 19, 2019, 4:36am UTC](https://discuss.elastic.co/t/rename-index-in-elasticsearch/190166/12 "2019-08-19T04:36:30Z")

</div>

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