indices.asciidoc 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. [role="xpack"]
  2. [[config-monitoring-indices]]
  3. == Configuring indices for monitoring
  4. Sometimes the default index settings might not work for your situation. For
  5. example, you might want to change index lifecycle management (ILM) settings,
  6. add custom mappings, or set the number of shards and replicas
  7. for the monitoring indices.
  8. You can change the default behavior. The steps you follow depend on which data
  9. collection method is used.
  10. [float]
  11. === Configuring data streams created by {agent}
  12. {agent} uses data streams to store time series data across multiple indices
  13. while giving you a single named resource for requests. You can alter the
  14. settings of each dataset by configuring an `@custom` component template.
  15. For more information, refer to {fleet-guide}/data-streams.html[Data streams].
  16. [float]
  17. === Configuring indices created by {metricbeat}
  18. <<indices-templates-v1,Index templates>> are used to configure the indices that
  19. store the monitoring data that {metricbeat} collects from a cluster.
  20. You can retrieve the templates through the `_template` API:
  21. [source,console]
  22. ----------------------------------
  23. GET /_index_template/.monitoring-es-mb*
  24. ----------------------------------
  25. By default, the template configures one shard and one replica for the
  26. monitoring indices. To override the default settings, add your own template:
  27. . Set `index_patterns` to match existing `.monitoring-{product}-8-*` indices.
  28. . Set the template `priority` to `1`. This ensures your template is
  29. applied after the default template, which has an priority of 0.
  30. . Specify the `number_of_shards` and/or `number_of_replicas` in the `settings`
  31. section.
  32. For example, the following template increases the number of shards to five
  33. and the number of replicas to two.
  34. [source,console]
  35. ----------------------------------
  36. PUT /_index_template/custom_monitoring
  37. {
  38. "index_patterns": [
  39. ".monitoring-beats-8-*",
  40. ".monitoring-es-8-*",
  41. ".monitoring-kibana-8-*",
  42. ".monitoring-logstash-8-*",
  43. ".monitoring-ent-search-8-*"
  44. ],
  45. "priority": 1,
  46. "template": {
  47. "settings": {
  48. "number_of_shards": 5,
  49. "number_of_replicas": 2
  50. }
  51. }
  52. }
  53. ----------------------------------
  54. //////////////////////////
  55. [source,console]
  56. --------------------------------------------------
  57. DELETE /_index_template/custom_monitoring
  58. --------------------------------------------------
  59. // TEST[continued]
  60. //////////////////////////
  61. IMPORTANT: Only set the `number_of_shards` and `number_of_replicas` in the
  62. settings section. Overriding other monitoring template settings could cause
  63. your monitoring dashboards to stop working correctly.