data-views-v2

Upsert a data view

Spaces method and path for this operation:

<div><span class="operation-verb put">put</span>&nbsp;<span class="operation-path">/s/{space_id}/api/data_views/v2/{id}</span></div>

Refer to Spaces for more information.

Creates the data view with the ID in the path, or replaces its definition if it already exists. Returns 201 when the request creates a data view and 200 when it replaces one. A replacement removes any optional property you omit, such as time_field.<br/><br/>[Required authorization] Route required privileges: indexPatterns:manage.

put/api/data_views/v2/{id}

Request

  • Base URL
    https://localhost:5601
  • URL
    https://localhost:5601/api/data_views/v2/{id}
  • Auth
    • API key in header Authorization
    • or HTTP basic

Path parameters

idstring required

The ID of the data view to create or update.

Headers

kbn-xsrfstring required
Example:true

A required header to protect against CSRF attacks

Request body

allow_hidden_indicesboolean

When true, allows the data view to match hidden indices.

field_filtersstring[]

Field filters can be used to exclude one or more fields when fetching a document. They may contain wildcards, such as user* which filters fields starting with 'user'.

field_settingsobject

Settings for individual fields, keyed by field name. To change how Kibana displays a field from the backing indices, set its label, description, format, or popularity. To define a runtime field, use the runtime field name and set type.

index_patternstring required

The index pattern (Elasticsearch index expression) to use as the data source. Example: "my-index-*".

namestring

The name of the data view. Example: "Sample data view".

time_fieldstring

The name of the time field in the index. Used for time-based filtering. Example: "@timestamp".

Response

updated

idstring required

The ID of the data view.

Changes