# Xpack: How to clean monitoring-es-7\*?

**URL:** https://discuss.elastic.co/t/xpack-how-to-clean-monitoring-es-7/281267
**Category:** Kibana
**Tags:** elastic-stack-monitoring
**Created:** [August 12, 2021, 9:27pm UTC](https://discuss.elastic.co/t/xpack-how-to-clean-monitoring-es-7/281267 "2021-08-12T21:27:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Ajordao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ajordao/32/92938_2.png) [@Ajordao](https://discuss.elastic.co/u/Ajordao)
#### Post date: [August 12, 2021, 9:27pm UTC](https://discuss.elastic.co/t/xpack-how-to-clean-monitoring-es-7/281267/1 "2021-08-12T21:27:53Z")

</div>

Hi, everyone! I'm beginner in ES, but I already have some tasks to be accomplished.  
I have two deploys in Elastic's Cloud, one of them is to stored monitoring data (Deploy 2).  
I can't understand the reason why for the Elastic doesn't delete the old monitoring-es-7\* logs.  
I have no idea if I'm in right way, but I think that this commands are necessary for throubleshooting (sorry! 🙂 ).  
The deploys's configurations:  
In Deploy 2 (monitoring):  
GET \_cluster/settings

```auto
{
  "persistent" : {
    "action" : {
      "auto_create_index" : ".ent-search-*-logs-*,-.ent-search-*,+*"
    },
...
    "xpack" : {
      "monitoring" : {
        "migration" : {
          "decommission_alerts" : "true"
        },
        "collection" : {
          "enabled" : "false",
          "interval" : "10s"
        },
        "history" : {
          "duration" : "3d"
        },
        "exporters" : {
          " __no-default-local__" : {
            "type" : "local",
            "enabled" : "false"
          }
...

```

GET /_monitoring-es-_/\_ilm/explain

```auto
{
  "indices" : {
    ".monitoring-es-7-2021.08.04" : {
      "index" : ".monitoring-es-7-2021.08.04",
      "managed" : false
    },
    ".monitoring-es-7-2021.08.03" : {
      "index" : ".monitoring-es-7-2021.08.03",
      "managed" : false
    },
...

```

GET /\_template/.monitoring-es

```auto
{
  ".monitoring-es" : {
    "order" : 0,
    "version" : 7120099,
    "index_patterns" : [
      ".monitoring-es-7-*"
    ],
    "settings" : {
      "index" : {
        "format" : "7",
        "codec" : "best_compression",
        "number_of_shards" : "1",
        "auto_expand_replicas" : "0-1",
        "number_of_replicas" : "0"
      }
    },
...

```

In Deploy 1 (My db)  
GET \_cluster/settings

```auto
{
 ...
    },
    "xpack" : {
      "monitoring" : {
        "collection" : {
          "enabled" : "true",
          "interval" : "10s"
        },
        "exporters" : {
          " __no-default-local__" : {
            "type" : "local",
            "enabled" : "false"
          },
          "found-user-defined" : {
            "host" : [
              "http://containerhost:9244"
            ],
            "headers" : {
              ...
            },
            "type" : "http",
            "enabled" : "true"
          }
        },
        "history" : {
          "duration" : "3d"
        }
      },
...

```

GET /\_template/.monitoring-es\*

```auto
{
  ".monitoring-es" : {
    "order" : 0,
    "version" : 7000199,
    "index_patterns" : [
      ".monitoring-es-7-*"
    ],
    "settings" : {
      "index" : {
        "format" : "7",
        "codec" : "best_compression",
        "number_of_shards" : "1",
        "auto_expand_replicas" : "0-1",
        "number_of_replicas" : "0"
      }
    },
...

```

Thank's!

---

<div class="post-metadata">

### Author: ![Ajordao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ajordao/32/92938_2.png) [@Ajordao](https://discuss.elastic.co/u/Ajordao)
#### Post date: [August 16, 2021, 8:47pm UTC](https://discuss.elastic.co/t/xpack-how-to-clean-monitoring-es-7/281267/2 "2021-08-16T20:47:06Z")

</div>

Update.

I created ILM "Monitoring" and after I updated .monitoring-es in Index Management \> Legacy Index Templates.  
I added "... `"lifecycle": { "name": "monitoring" }` ..." in Settings.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [September 13, 2021, 8:47pm UTC](https://discuss.elastic.co/t/xpack-how-to-clean-monitoring-es-7/281267/3 "2021-09-13T20:47:14Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
