Spec-Zone.ru › Elasticsearch 8
›Elasticsearch Guide [8.17] ›Monitor a cluster ›Configuring data streams/indices for monitoring

Configuring indices created by Metricbeat 7 or internal collection

When monitoring using Metricbeat 7 or internal collection, data is stored in a set of indices called either:

  • .monitoring-{product}-7-mb-{date}, when using Metricbeat 7.
  • .monitoring-{product}-7-{date}, when using internal collection.

The settings and mappings for these indices are determined by legacy index templates named .monitoring-{product}. You can retrieve these templates in Kibana by navigating to Stack Management > Index Management > Index Templates, or by using the Elasticsearch _template API:

resp = client.indices.get_template(
    name=".monitoring-*",
)
print(resp)
response = client.indices.get_template(
  name: '.monitoring-*'
)
puts response
const response = await client.indices.getTemplate({
  name: ".monitoring-*",
});
console.log(response);
GET /_template/.monitoring-*

To change the settings of the indices, add a custom index template. You can do that in Kibana, or using the Elasticsearch API:

  • Set index_patterns to match the .monitoring-{product}-7-* indices.
  • Set the template order to 1. This ensures your template is applied after the default template, which has an order of 0.
  • Specify the number_of_shards and/or number_of_replicas in the settings section.
resp = client.indices.put_template(
    name="custom_monitoring",
    index_patterns=[
        ".monitoring-beats-7-*",
        ".monitoring-es-7-*",
        ".monitoring-kibana-7-*",
        ".monitoring-logstash-7-*"
    ],
    order=1,
    settings={
        "number_of_shards": 5,
        "number_of_replicas": 2
    },
)
print(resp)
response = client.indices.put_template(
  name: 'custom_monitoring',
  body: {
    index_patterns: [
      '.monitoring-beats-7-*',
      '.monitoring-es-7-*',
      '.monitoring-kibana-7-*',
      '.monitoring-logstash-7-*'
    ],
    order: 1,
    settings: {
      number_of_shards: 5,
      number_of_replicas: 2
    }
  }
)
puts response
const response = await client.indices.putTemplate({
  name: "custom_monitoring",
  index_patterns: [
    ".monitoring-beats-7-*",
    ".monitoring-es-7-*",
    ".monitoring-kibana-7-*",
    ".monitoring-logstash-7-*",
  ],
  order: 1,
  settings: {
    number_of_shards: 5,
    number_of_replicas: 2,
  },
});
console.log(response);
PUT /_template/custom_monitoring
{
  "index_patterns": [".monitoring-beats-7-*", ".monitoring-es-7-*", ".monitoring-kibana-7-*", ".monitoring-logstash-7-*"],
  "order": 1,
  "settings": {
    "number_of_shards": 5,
    "number_of_replicas": 2
  }
}

After changing the index template, the updated settings are only applied to new indices.

© 2023-2025 Elasticsearch
As of September 2024, Elasticsearch is available under a choice of three licenses: the Server Side Public License (SSPL), the Elastic License, or the AGPLv3 (OSI approved).
Elasticsearch and the Elasticsearch logo are trademarks of Elasticsearch B.V., registered in the U.S. and in other countries.
https://www.elastic.co/guide/en/elasticsearch/reference/8.17/config-monitoring-indices-metricbeat-7-internal-collection.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API