Spaces method and path for this operation:
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.
[Required authorization] Route required privileges: indexPatterns:manage.
Body
-
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'.Not more than
10000elements. Minimum length of each is1, maximum length of each is1000. -
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. -
The index pattern (Elasticsearch index expression) to use as the data source. Example: "my-index-*".
Minimum length is
1. -
The name of the data view. Example: "Sample data view".
Minimum length is
1, maximum length is256. -
The name of the time field in the index. Used for time-based filtering. Example: "@timestamp".
curl \
--request POST 'https://localhost:5601/api/data_views/v2' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true" \
--data '{
"index_pattern": "logs-*",
"name": "Web logs",
"time_field": "@timestamp"
}'
{
"index_pattern": "logs-*",
"name": "Web logs",
"time_field": "@timestamp"
}
{
"data": {
"index_pattern": "logs-*",
"name": "Web logs",
"time_field": "@timestamp"
},
"id": "c0ffee00-d57a-11ef-9a52-4f3c2a8d0e1b",
"meta": {
"managed": false,
"spaces": [
"default"
],
"version": "WzEsMV0="
}
}