Update index pattern APIedit

[experimental] This functionality is experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features. Update part of an index pattern. Only the specified fields are updated in the index pattern. Unspecified fields stay as they are persisted.

Requestedit

POST <kibana host>:<port>/api/index_patterns/index_pattern/<id>

POST <kibana host>:<port>/s/<space_id>/api/index_patterns/index_pattern/<id>

Path parametersedit

space_id
(Optional, string) An identifier for the space. If space_id is not provided in the URL, the default space is used.
id
(Required, string) The ID of the index pattern you want to update.

Request bodyedit

refresh_fields
(Optional, boolean) Reloads the index pattern fields after the index pattern is updated. The default is false.
index_pattern

(Required, object) The index patterns fields you want to update.

You can partially update the following fields:

  • title
  • timeFieldName
  • fields
  • sourceFilters
  • fieldFormatMap
  • type
  • typeMeta

Response codeedit

200
Indicates a successful call.

Examplesedit

Update a title of the <my-pattern> index pattern:

$ curl -X POST api/saved_objects/index-pattern/my-pattern
{
  "index_pattern": {
    "title": "some-other-pattern-*"
  }
}

Customize the update behavior:

$ curl -X POST api/saved_objects/index-pattern/my-pattern
{
  "refresh_fields": true,
  "index_pattern": {
    "fields": {}
  }
}

All update fields are optional, but you can specify the following fields:

$ curl -X POST api/saved_objects/index-pattern/my-pattern
{
  "index_pattern": {
    "title": "...",
    "timeFieldName": "...",
    "sourceFilters": [],
    "fieldFormats": {},
    "type": "...",
    "typeMeta": {},
    "fields": {}
  }
}

The API returns the updated index pattern object:

{
    "index_pattern": {

    }
}