# How to assign an Alias in an existing Index

**URL:** <https://discuss.elastic.co/t/how-to-assign-an-alias-in-an-existing-index/286233>\
**Category:** Kibana\
**Created:** [October 8, 2021, 12:10pm UTC](https://discuss.elastic.co/t/how-to-assign-an-alias-in-an-existing-index/286233 "2021-10-08T12:10:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![qttv](https://avatars.discourse-cdn.com/v4/letter/q/ee59a6/32.png) [@qttv](https://discuss.elastic.co/u/qttv)\
**Post date:** [October 8, 2021, 12:10pm UTC](https://discuss.elastic.co/t/how-to-assign-an-alias-in-an-existing-index/286233/1 "2021-10-08T12:10:39Z")

</div>

Good Morning,

I'm using Kibana version 7.0, and I need to assign an alias to a filed into an existing Index that i can't delete.

This field is named "processName" and I need to rename it as "processname". I read the documentation about aliasing, but when I try to assign the Alias on _Development Tools_ i still have some errors. The following is the code i'm trying to use:

```auto
PUT my-index
{
  "mappings": {
    "properties": {
      "processname": {
        "type": "alias",
        "path": "processName" 
      },
    }
  }
}

```

The error I'm facing with is the following:

```auto
  "error": {
    "root_cause": [
      {
        "type": "resource_already_exists_exception",
        "reason": "index [my-index/FFItdoUZT5eNw49rQNjpPQ] already exists",
        "index_uuid": "FFItdoUZT5eNw49rQNjpPQ",
        "index": "my-index"
      }

```

Can you help me to obtain what I need?

---

<div class="post-metadata">

**Author:** ![mattkime](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattkime/32/43522_2.png) [@mattkime](https://discuss.elastic.co/u/mattkime)\
**Post date:** [October 8, 2021, 2:19pm UTC](https://discuss.elastic.co/t/how-to-assign-an-alias-in-an-existing-index/286233/2 "2021-10-08T14:19:54Z")

</div>

Hello @qttv

From [Explicit mapping | Elasticsearch Guide [7.15] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/explicit-mapping.html#explicit-mapping)

`PUT my-index` creates a new index. `PUT /my-index-000001/_mapping` updates an existing index's mapping.

---

<div class="post-metadata">

**Author:** ![qttv](https://avatars.discourse-cdn.com/v4/letter/q/ee59a6/32.png) [@qttv](https://discuss.elastic.co/u/qttv)\
**Post date:** [October 8, 2021, 2:29pm UTC](https://discuss.elastic.co/t/how-to-assign-an-alias-in-an-existing-index/286233/3 "2021-10-08T14:29:03Z")

</div>

Hi @mattkime, using this approach I obtain that error:

{  
"error" : {  
"root\_cause" : [  
{  
"type" : "index\_not\_found\_exception",  
"reason" : "no such index [my-index-000001]",  
"resource.type" : "index\_or\_alias",  
"resource.id" : "my-index-000001",  
"index\_uuid" : "_na_",  
"index" : "my-index-000001"  
}  
],  
"type" : "index\_not\_found\_exception",  
"reason" : "no such index [my-index-000001]",  
"resource.type" : "index\_or\_alias",  
"resource.id" : "my-index-000001",  
"index\_uuid" : "_na_",  
"index" : "my-index-000001"  
},  
"status" : 404  
}

It seams to read the "-000001" as a part of the index name. Any idea for a possible solution?

---

<div class="post-metadata">

**Author:** ![mattkime](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattkime/32/43522_2.png) [@mattkime](https://discuss.elastic.co/u/mattkime)\
**Post date:** [October 8, 2021, 2:39pm UTC](https://discuss.elastic.co/t/how-to-assign-an-alias-in-an-existing-index/286233/4 "2021-10-08T14:39:11Z")

</div>

> Any idea for a possible solution?

remove that portion

---

<div class="post-metadata">

**Author:** ![qttv](https://avatars.discourse-cdn.com/v4/letter/q/ee59a6/32.png) [@qttv](https://discuss.elastic.co/u/qttv)\
**Post date:** [October 8, 2021, 2:58pm UTC](https://discuss.elastic.co/t/how-to-assign-an-alias-in-an-existing-index/286233/5 "2021-10-08T14:58:58Z")

</div>

Thanks @mattkime, it seems to work!

Aniway, inside my Dashboard this Alias seems to not be searchable ( in the discover it works fine ). In fact, inside the Dashboard, if I filtrate a specific **processname** from a visualization, there is a "Saved Search" that become empty (the Alias **processName** is not found as part of the list). Is there a way to use filters with an Alias?

---

<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:** [October 11, 2021, 12:26am UTC](https://discuss.elastic.co/t/how-to-assign-an-alias-in-an-existing-index/286233/6 "2021-10-11T00:26:22Z")

</div>

FYI 7.0 is very long past [EOL](https://www.elastic.co/support/eol). Please upgrade ASAP! 🙂

---

<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:** [November 8, 2021, 12:27am UTC](https://discuss.elastic.co/t/how-to-assign-an-alias-in-an-existing-index/286233/7 "2021-11-08T00:27:19Z")

</div>

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