elasticsearchsearchkibanakibana-6

How to update the timeFieldName in index Pattern in Kibana


I am trying to update the timeField for a index pattern using the below code but I am getting an document missing exception. I have fetched correct id from the Index patterns URL. Could someone guide me how to update this.

POST /{_index}/_update/{_id}/ 
{ "doc": 
     { "index-pattern": 
         { "timeFieldName" : "{NEW_FIELD_NAME}" } 
     } 
}

Solution

  • Make sure to prefix the id with index-pattern:<id>, like below:

    POST /{_index}/_update/index-pattern:{_id}/ 
    { "doc": 
         { "index-pattern": 
             { "timeFieldName" : "{NEW_FIELD_NAME}" } 
         } 
    }