mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 10:23:14 -04:00
67 lines
1.6 KiB
Text
67 lines
1.6 KiB
Text
[[index-patterns-api-get]]
|
|
=== Get index pattern API
|
|
++++
|
|
<titleabbrev>Get index pattern</titleabbrev>
|
|
++++
|
|
|
|
deprecated::[8.0.0,Use <<data-views-api-get>> instead.]
|
|
|
|
experimental[] Retrieve a single {kib} index pattern by ID.
|
|
|
|
[[index-patterns-api-get-request]]
|
|
==== Request
|
|
|
|
`GET <kibana host>:<port>/api/index_patterns/index_pattern/<id>`
|
|
|
|
`GET <kibana host>:<port>/s/<space_id>/api/index_patterns/index_pattern/<id>`
|
|
|
|
[[index-patterns-api-get-params]]
|
|
==== Path parameters
|
|
|
|
`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 retrieve.
|
|
|
|
[[index-patterns-api-get-codes]]
|
|
==== Response code
|
|
|
|
`200`::
|
|
Indicates a successful call.
|
|
|
|
`404`::
|
|
The specified index pattern and ID doesn't exist.
|
|
|
|
[[index-patterns-api-get-example]]
|
|
==== Example
|
|
|
|
Retrieve the index pattern object with the `my-pattern` ID:
|
|
|
|
[source,sh]
|
|
--------------------------------------------------
|
|
$ curl -X GET api/index_patterns/index_pattern/my-pattern
|
|
--------------------------------------------------
|
|
// KIBANA
|
|
|
|
The API returns an index pattern object:
|
|
|
|
[source,sh]
|
|
--------------------------------------------------
|
|
{
|
|
"index_pattern": {
|
|
"id": "my-pattern",
|
|
"version": "...",
|
|
"title": "...",
|
|
"type": "...",
|
|
"timeFieldName": "...",
|
|
"sourceFilters": [],
|
|
"fields": {},
|
|
"typeMeta": {},
|
|
"fieldFormats": {},
|
|
"fieldAttrs": {},
|
|
"runtimeFieldMap" {},
|
|
"allowNoIndex: "..."
|
|
}
|
|
}
|
|
--------------------------------------------------
|