# Implementation of ISM Policy for Detection of Outdated Indexes

**URL:** <https://forum.opensearch.org/t/implementation-of-ism-policy-for-detection-of-outdated-indexes/17108>\
**Category:** Index Management\
**Created:** [December 15, 2023, 11:46am UTC](https://forum.opensearch.org/t/implementation-of-ism-policy-for-detection-of-outdated-indexes/17108 "2023-12-15T11:46:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnenderson](https://avatars.discourse-cdn.com/v4/letter/j/87869e/32.png) [@johnenderson](https://forum.opensearch.org/u/johnenderson)\
**Post date:** [December 15, 2023, 11:46am UTC](https://forum.opensearch.org/t/implementation-of-ism-policy-for-detection-of-outdated-indexes/17108/1 "2023-12-15T11:46:22Z")

</div>

**Versions** (relevant - OpenSearch/Dashboard/Server OS/Browser):

Amazon OpenSearch Service 1.2

**Describe the issue** :

Good morning, I would like to know if there is any direct method or strategy to set up an ISM policy that helps detect indexes that have not been updated for more than 60 days, for example.

**Configuration** :

```auto
{
  "policy": {
    "description": "Policy to close indices after 60 days of inactivity.",
    "error_notification": {
      "destination": {
        "custom_webhook": {
          "header_params": {
            "Content-Type": "application/json"
          },
          "url": ""
        }
      },
      "message_template": {
        "source": "The index {{ctx.index}} failed during policy execution.",
        "lang": "mustache"
      }
    },
    "default_state": "init",
    "states": [
      {
        "name": "init",
        "actions": [],
        "transitions": [
          {
            "state_name": "close",
            "conditions": {
              "min_index_age": "60d"
            }
          }
        ]
      },
      {
        "name": "close",
        "actions": [
          {
            "close": {}
          },
          {
            "notification": {
              "destination": {
                "custom_webhook": {
                  "path": null,
                  "header_params": {
                    "Content-Type": "application/json"
                  },
                  "url": ""
                }
              },
              "message_template": {
                "source": {
                  "@context": "https://schema.org/extensions",
                  "@type": "MessageCard",
                  "summary": "OpenSearch Posted",
                  "themeColor": "0072C6",
                  "title": "Amazon OpenSearch Service Posted",
                  "sections": [
                    {
                      "startGroup": true,
                      "title": " **Index Closure Policy: 60 Days of Inactivity**",
                      "text": "Este índice foi fechado após 60 dias de inatividade, conforme política.",
                      "facts": [
                        {
                          "name": "Nome do índice:",
                          "value": "{{ctx.index}}"
                        },
                        {
                          "name": "UUID do índice:",
                          "value": "{{ctx.index_uuid}}"
                        },
                        {
                          "name": "Nome da política:",
                          "value": "{{ctx.policy_id}}"
                        },
                        {
                          "name": "Região:",
                          "value": "us-east-1 (Framework Arena)"
                        },
                        {
                          "name": "Versão OpenSearch",
                          "value": "v1.2.0"
                        }
                      ]
                    }
                  ]
                },
                "lang": "mustache",
                "options": {
                  "content_type": "application/json; charset=UTF-8"
                }
              }
            }
          }
        ],
        "transitions": []
      }
    ],
    "ism_template": [
      {
        "index_patterns": ["host*"],
        "priority": 1
      }
    ]
  }
}

```

**Relevant Logs or Screenshots** :

---

<div class="post-metadata">

**Author:** ![hm21](https://avatars.discourse-cdn.com/v4/letter/h/8dc957/32.png) [@hm21](https://forum.opensearch.org/u/hm21)\
**Post date:** [December 15, 2023, 7:39pm UTC](https://forum.opensearch.org/t/implementation-of-ism-policy-for-detection-of-outdated-indexes/17108/2 "2023-12-15T19:39:29Z")

</div>

i thought ISM stands for Index State Management

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/3/33547ea01a5b12dcca2958411d3edd97ae2ea8c1.png) [@system](https://forum.opensearch.org/u/system)\
**Post date:** [February 13, 2024, 7:39pm UTC](https://forum.opensearch.org/t/implementation-of-ism-policy-for-detection-of-outdated-indexes/17108/3 "2024-02-13T19:39:56Z")

</div>

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