How to assign an Alias in an existing Index

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:

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

The error I'm facing with is the following:

  "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?

Hello @qttv

From Explicit mapping | Elasticsearch Guide [7.15] | Elastic

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

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?

Any idea for a possible solution?

remove that portion

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?

FYI 7.0 is very long past EOL. Please upgrade ASAP! :slight_smile:

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