elasticsearch/docs/reference/monitoring/indices.asciidoc
Ramdas Potale 845f7a11ed
updated correct API to get index templates etc (#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 <abdon.pijpelink@elastic.co>

* 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 <abdon.pijpelink@elastic.co>
2023-02-20 16:47:34 +01:00

59 lines
1.8 KiB
Text

[role="xpack"]
[[config-monitoring-indices]]
== Configuring indices for monitoring
<<indices-templates-v1,Index templates>> are used to configure the indices
that store the monitoring data collected from a cluster.
You can retrieve the templates through the `_template` API:
[source,console]
----------------------------------
GET /_index_template/.monitoring-es-mb*
----------------------------------
By default, the template configures one shard and one replica for the
monitoring indices. To override the default settings, add your own template:
. Set `index_patterns` to match existing `.monitoring-{product}-8-*` indices.
. Set the template `priority` to `1`. This ensures your template is
applied after the default template, which has an priority of 0.
. Specify the `number_of_shards` and/or `number_of_replicas` in the `settings`
section.
For example, the following template increases the number of shards to five
and the number of replicas to two.
[source,console]
----------------------------------
PUT /_index_template/custom_monitoring
{
"index_patterns": [
".monitoring-beats-8-*",
".monitoring-es-8-*",
".monitoring-kibana-8-*",
".monitoring-logstash-8-*"
],
"priority": 1,
"template": {
"settings": {
"number_of_shards": 5,
"number_of_replicas": 2
}
}
}
----------------------------------
//////////////////////////
[source,console]
--------------------------------------------------
DELETE /_index_template/custom_monitoring
--------------------------------------------------
// TEST[continued]
//////////////////////////
IMPORTANT: Only set the `number_of_shards` and `number_of_replicas` in the
settings section. Overriding other monitoring template settings could cause
your monitoring dashboards to stop working correctly.