Upsert a data view
- Base URL
-
https://{kibana_url}
- PUT /api/data_views/v2/{id}
- PUT /s/{space_id}/api/data_views/v2/{id}
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.
Required privileges
- Privileges indexPatterns:manage
Path parameters
-
space_idstringoptional -
An identifier for the space. If
space_idis not provided in the URL, the default space is used. Refer to Spaces for more information.
Request body
-
field_filtersstring[] · max items: 10000 -
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_settingsmap string to anyOf -
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. -
<string>union anyOf -
fieldsmap string to objectrequired -
<string>object -
custom_descriptionstring · min length: 1 -
Add a description to the field. It's displayed next to the field on the Discover, Lens, and Data View Management pages.
-
custom_labelstring · min length: 1 -
Create a label to display in place of the field name in Discover, Maps, Lens, Visualize, and TSVB. Useful for shortening a long field name. Queries and filters use the original field name.
-
formatunion anyOf -
Set your preferred format for displaying the value. Changing the format can affect the value and prevent highlighting in Discover.
- Any of:
-
paramsobject -
patternstring -
Numeral.js format pattern. See https://www.elastic.co/docs/explore-analyze/numeral-formatting to learn more.
-
paramsunion oneOfrequired -
One of:
(determined by
field_type) -
patternstring -
Numeral.js format pattern. See https://www.elastic.co/docs/explore-analyze/numeral-formatting to learn more.
-
paramsobject -
patternstring · default: MMM D, YYYY @ HH:mm:ss.SSSSSSSSS -
Moment.js format pattern. See https://momentjs.com/ to learn more.
-
paramsobject -
patternstring · default: MMM D, YYYY @ HH:mm:ss.SSS -
Moment.js format pattern. See https://momentjs.com/ to learn more.
-
paramsobjectrequired -
include_space_with_suffixboolean · default: true -
When true or not provided, the formatted duration includes a space between the value and suffix. When false, no space is included.
-
input_formatenumrequired -
The unit of the field value before formatting.
-
Values:
picosecondsnanosecondsmicrosecondsmillisecondssecondsminuteshoursdaysweeksmonthsyears -
output_formatenumrequired -
The unit to convert the field value into for display.
-
Values:
humanizehumanize_preciseas_millisecondsas_secondsas_minutesas_hoursas_daysas_weeksas_monthsas_years -
paramsobjectrequired -
patternstring -
Numeral.js format pattern. See https://www.elastic.co/docs/explore-analyze/numeral-formatting to learn more.
-
paramsobject -
patternstring -
Numeral.js format pattern. See https://www.elastic.co/docs/explore-analyze/numeral-formatting to learn more.
-
paramsobject -
patternstring -
Numeral.js format pattern. See https://www.elastic.co/docs/explore-analyze/numeral-formatting to learn more.
-
paramsunion oneOfrequired -
One of:
(determined by
type) -
label_templatestring -
The template to use for the label. The template is a string that contains the field value. The field value is replaced with the template. The available placeholders are:
{{value}},{{rawValue}}and{{url}}. For example: "{{value}}". -
open_link_in_current_tabboolean -
When true, the URL opens in the current tab. When false or not provided, the URL opens in a new tab.
-
url_templatestring -
The template to use for the URL. The template is a string that contains the field value. The field value is replaced with the template. The available placeholders are:
{{value}},{{rawValue}}and{{risonValue}}. Use{{risonValue}}when embedding the field value inside Kibana app URL rison state (for example: query:'{{risonValue}}'). For example: "https://example.com/{{value}}". -
heightnumber -
The height of the image. If not provided, the image will be displayed at the original height.
-
label_templatestring -
The template to use for the label. The template is a string that contains the field value. The field value is replaced with the template. The available placeholders are:
{{value}},{{rawValue}}and{{url}}. For example: "{{value}}". -
url_templatestring -
The template to use for the URL. The template is a string that contains the field value. The field value is replaced with the template. The available placeholders are:
{{value}},{{rawValue}}and{{risonValue}}. Use{{risonValue}}when embedding the field value inside Kibana app URL rison state (for example: query:'{{risonValue}}'). For example: "https://example.com/{{value}}". -
label_templatestring -
The template to use for the label. The template is a string that contains the field value. The field value is replaced with the template. The available placeholders are:
{{value}},{{rawValue}}and{{url}}. For example: "{{value}}". -
url_templatestring -
The template to use for the URL. The template is a string that contains the field value. The field value is replaced with the template. The available placeholders are:
{{value}},{{rawValue}}and{{risonValue}}. Use{{risonValue}}when embedding the field value inside Kibana app URL rison state (for example: query:'{{risonValue}}'). For example: "https://example.com/{{value}}". -
custom_descriptionstring · min length: 1 -
Add a description to the field. It's displayed next to the field on the Discover, Lens, and Data View Management pages.
-
custom_labelstring · min length: 1 -
Create a label to display in place of the field name in Discover, Maps, Lens, Visualize, and TSVB. Useful for shortening a long field name. Queries and filters use the original field name.
-
formatunion anyOf -
Set your preferred format for displaying the value. Changing the format can affect the value and prevent highlighting in Discover.
-
Same options as
formatinfields -
popularitynumber · min: 0 -
Adjust the popularity to make the field appear higher or lower in the fields list. By default, Discover orders fields from most selected to least selected.
-
custom_descriptionstring · min length: 1 -
Add a description to the field. It's displayed next to the field on the Discover, Lens, and Data View Management pages.
-
custom_labelstring · min length: 1 -
Create a label to display in place of the field name in Discover, Maps, Lens, Visualize, and TSVB. Useful for shortening a long field name. Queries and filters use the original field name.
-
formatunion anyOf -
Set your preferred format for displaying the value. Changing the format can affect the value and prevent highlighting in Discover.
-
Same options as
formatinfields -
index_patternstring · min length: 1required -
The index pattern (Elasticsearch index expression) to use as the data source. Example: "my-index-*".
Formats a field into a bytes value following the numeral.js format pattern. The default pattern is defined by the format:bytes:defaultPattern advanced setting.
Formats a field into a color value.
field_type: string
field_type: number
field_type: boolean
Formats a field into a currency value. The format is determined by the pattern of the format:currency:defaultPattern advanced setting.
Formats a field into a date nanos value following the defined pattern.
Formats a field into a date value following the defined pattern.
Formats a field into a duration value.
Formats a field into a geo point value.
Formats a histogram field into a numeric value following the defined pattern. The default pattern is defined by format:bytes:defaultPattern, format:percent:defaultPattern or format:number:defaultPattern advanced settings depending on the selected format.
Formats a field into a numeric value following the defined pattern. The default pattern is defined by format:number:defaultPattern advanced setting.
Formats a field into a percentage value following the defined pattern. The default pattern is defined by format:percent:defaultPattern advanced setting.
Formats a field into a relative date value. For example: "1 day ago".
Formats a field into a static value based on the lookup entries or the unknown key value.
Formats a field into a string value.
Truncates the field value to the specified length. If the field value is longer than the specified length, it will be truncated and the remaining text will be replaced with "...".
Formats a field into a link, image or audio.
type: a
type: img
type: audio
Display overrides for a field. These settings can define a custom label, description, format and popularity.
Responses
updated
-
dataobjectrequired -
Defines an stored data source with a mandatory index pattern and optional settings like id, name, show hidden indices and field settings.
-
field_filtersstring[] · max items: 10000 -
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_settingsmap string to anyOf -
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. -
<string>union anyOf -
fieldsmap string to objectrequired -
<string>object -
custom_descriptionstring · min length: 1 -
Add a description to the field. It's displayed next to the field on the Discover, Lens, and Data View Management pages.
-
custom_labelstring · min length: 1 -
Create a label to display in place of the field name in Discover, Maps, Lens, Visualize, and TSVB. Useful for shortening a long field name. Queries and filters use the original field name.
-
formatunion anyOf -
Set your preferred format for displaying the value. Changing the format can affect the value and prevent highlighting in Discover.
-
Same options as
formatinfields -
custom_descriptionstring · min length: 1 -
Add a description to the field. It's displayed next to the field on the Discover, Lens, and Data View Management pages.
-
custom_labelstring · min length: 1 -
Create a label to display in place of the field name in Discover, Maps, Lens, Visualize, and TSVB. Useful for shortening a long field name. Queries and filters use the original field name.
-
formatunion anyOf -
Set your preferred format for displaying the value. Changing the format can affect the value and prevent highlighting in Discover.
-
Same options as
formatinfields -
popularitynumber · min: 0 -
Adjust the popularity to make the field appear higher or lower in the fields list. By default, Discover orders fields from most selected to least selected.
-
custom_descriptionstring · min length: 1 -
Add a description to the field. It's displayed next to the field on the Discover, Lens, and Data View Management pages.
-
custom_labelstring · min length: 1 -
Create a label to display in place of the field name in Discover, Maps, Lens, Visualize, and TSVB. Useful for shortening a long field name. Queries and filters use the original field name.
-
formatunion anyOf -
Set your preferred format for displaying the value. Changing the format can affect the value and prevent highlighting in Discover.
-
Same options as
formatinfields -
idstring · min length: 1 · max length: 256 -
Kibana provides a unique identifier for each data view, or you can create your own.
-
index_patternstring · min length: 1required -
The index pattern (Elasticsearch index expression) to use as the data source. Example: "my-index-*".
Display overrides for a field. These settings can define a custom label, description, format and popularity.
created
-
dataobjectrequired -
Defines an stored data source with a mandatory index pattern and optional settings like id, name, show hidden indices and field settings.
-
Same fields as
data
invalid request
forbidden
conflict