12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- [role="xpack"]
- [[config-monitoring-indices]]
- == Configuring indices for monitoring
- Sometimes the default index settings might not work for your situation. For
- example, you might want to change index lifecycle management (ILM) settings,
- add custom mappings, or set the number of shards and replicas
- for the monitoring indices.
- You can change the default behavior. The steps you follow depend on which data
- collection method is used.
- [float]
- === Configuring data streams created by {agent}
- {agent} uses data streams to store time series data across multiple indices
- while giving you a single named resource for requests. You can alter the
- settings of each dataset by configuring an `@custom` component template.
- For more information, refer to {fleet-guide}/data-streams.html[Data streams].
- [float]
- === Configuring indices created by {metricbeat}
- <<indices-templates-v1,Index templates>> are used to configure the indices that
- store the monitoring data that {metricbeat} collects 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-*",
- ".monitoring-ent-search-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.
|