﻿---
title: Configuring stack monitoring indices created by legacy collection
description: To configure the data streams created by Elastic Agent or Metricbeat, refer to Configuring stack monitoring data streams and indices. When monitoring...
url: https://docs-v3-preview.elastic.dev/elastic/docs-content/tree/main/deploy-manage/monitor/monitoring-data/config-monitoring-indices-internal-collection
products:
  - Elastic Documentation
  - Elasticsearch
applies_to:
  - Self-managed Elastic deployments: Planned for removal, Deprecated since 7.16
---

# Configuring stack monitoring indices created by legacy collection
<warning>
  The Elasticsearch Monitoring plugin is deprecated and will be removed in 10.0. Choose one of the following replacements to monitor your Elasticsearch cluster:
  - **[AutoOps](https://docs-v3-preview.elastic.dev/elastic/docs-content/tree/main/deploy-manage/monitor/autoops)** (recommended): Simplifies cluster management through performance recommendations, resource utilization visibility, and real-time issue detection with resolution paths.
  - **Stack monitoring with [Elastic Agent](https://docs-v3-preview.elastic.dev/elastic/docs-content/tree/main/deploy-manage/monitor/stack-monitoring/collecting-monitoring-data-with-elastic-agent) or [Metricbeat](https://docs-v3-preview.elastic.dev/elastic/docs-content/tree/main/deploy-manage/monitor/stack-monitoring/collecting-monitoring-data-with-metricbeat)**: Collect logs and metrics from Elasticsearch and ship them to a monitoring cluster for visualization in Kibana.
  To help you decide, refer to the [AutoOps and Stack Monitoring comparison](https://docs-v3-preview.elastic.dev/elastic/docs-content/tree/main/deploy-manage/monitor/autoops-vs-stack-monitoring).
</warning>

To configure the data streams created by Elastic Agent or Metricbeat, refer to [Configuring stack monitoring data streams and indices](https://docs-v3-preview.elastic.dev/elastic/docs-content/tree/main/deploy-manage/monitor/monitoring-data/configuring-data-streamsindices-for-monitoring).
When monitoring using internal or legacy collection, data is stored in a set of indices called `.monitoring-{{product}}-7-{{date}}`. Internal collection is available for [Elasticsearch](https://docs-v3-preview.elastic.dev/elastic/docs-content/tree/main/deploy-manage/monitor/stack-monitoring/es-legacy-collection-methods), [Kibana](https://docs-v3-preview.elastic.dev/elastic/docs-content/tree/main/deploy-manage/monitor/stack-monitoring/kibana-monitoring-legacy), and [Beats](https://docs-v3-preview.elastic.dev/elastic/beats/tree/main/reference/filebeat/monitoring-internal-collection).
The `7` in the index name is the monitoring template version.
Indices created by Metricbeat 7 are called `.monitoring-{{product}}-7-mb-{{date}}`. If you still have these indices from an earlier version, the same templates and steps apply to them.
The settings and mappings for these indices are determined by [legacy index templates](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-template) named `.monitoring-{{product}}`.
You can retrieve these templates in Kibana. To manage index templates, go to the **Index Management** management page in the navigation menu or use the [global search field](https://docs-v3-preview.elastic.dev/elastic/docs-content/tree/main/explore-analyze/find-and-organize/find-apps-and-objects), and then select **Index Templates**,
You can also use the Elasticsearch `_template` API:
```console
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.

```console
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.