Skip to content

Commit ebe8a98

Browse files
ramdaspotaleabdonpijpelink
authored andcommitted
updated correct API to get index templates etc (elastic#93793)
* updated correct API to get index templates etc Hi, I think documentation needs correction on below points. 1. updated correct API to get index template 2. on line 18, it should be index pattern instead of template pattern 3. index pattern should have es version as 8 which matches elasticsearch version, also updated index patterns in API request payload * fix: grammatical correction to line 18 removed "the" from line 18 which is not very accuarate Co-authored-by: Abdon Pijpelink <[email protected]> * additional corrections to the docs as suggested by @abdonpijpelink . use the `_index_template` endpoint instead of just `_template` . change `order` to `priority` * settings need to be wrapped inside template obect --------- Co-authored-by: Abdon Pijpelink <[email protected]>
1 parent 712a0b5 commit ebe8a98

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

docs/reference/monitoring/indices.asciidoc

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ You can retrieve the templates through the `_template` API:
99

1010
[source,console]
1111
----------------------------------
12-
GET /_template/.monitoring-*
12+
GET /_index_template/.monitoring-es-mb*
1313
----------------------------------
1414

1515
By default, the template configures one shard and one replica for the
1616
monitoring indices. To override the default settings, add your own template:
1717

18-
. Set the `template` patterns to match existing `.monitoring-{product}-7-*` indices.
19-
. Set the template `order` to `1`. This ensures your template is
20-
applied after the default template, which has an order of 0.
18+
. Set `index_patterns` to match existing `.monitoring-{product}-8-*` indices.
19+
. Set the template `priority` to `1`. This ensures your template is
20+
applied after the default template, which has an priority of 0.
2121
. Specify the `number_of_shards` and/or `number_of_replicas` in the `settings`
2222
section.
2323

@@ -26,22 +26,29 @@ and the number of replicas to two.
2626

2727
[source,console]
2828
----------------------------------
29-
PUT /_template/custom_monitoring
29+
PUT /_index_template/custom_monitoring
3030
{
31-
"index_patterns": [".monitoring-beats-7-*", ".monitoring-es-7-*", ".monitoring-kibana-7-*", ".monitoring-logstash-7-*"],
32-
"order": 1,
33-
"settings": {
34-
"number_of_shards": 5,
35-
"number_of_replicas": 2
36-
}
31+
"index_patterns": [
32+
".monitoring-beats-8-*",
33+
".monitoring-es-8-*",
34+
".monitoring-kibana-8-*",
35+
".monitoring-logstash-8-*"
36+
],
37+
"priority": 1,
38+
"template": {
39+
"settings": {
40+
"number_of_shards": 5,
41+
"number_of_replicas": 2
42+
}
43+
}
3744
}
3845
----------------------------------
3946

4047
//////////////////////////
4148
4249
[source,console]
4350
--------------------------------------------------
44-
DELETE /_template/custom_monitoring
51+
DELETE /_index_template/custom_monitoring
4552
--------------------------------------------------
4653
// TEST[continued]
4754

0 commit comments

Comments
 (0)