data-views-v2

Create a data view

Spaces method and path for this operation:

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

Refer to Spaces for more information.

Creates a data view and returns it. Kibana generates the data view ID. If a data view with the same name already exists, the request fails with a conflict.<br/><br/>[Required authorization] Route required privileges: indexPatterns:manage.

post/api/data_views/v2

Request

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

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

The data view was created.

idstring required

The ID of the data view.

Changes

No operation changes recorded.