# Need some help with ISM Policy

**URL:** <https://forum.opensearch.org/t/need-some-help-with-ism-policy/21506>\
**Category:** OpenSearch\
**Tags:** discuss, index-management\
**Created:** [September 17, 2024, 8:01pm UTC](https://forum.opensearch.org/t/need-some-help-with-ism-policy/21506 "2024-09-17T20:01:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rvn](https://avatars.discourse-cdn.com/v4/letter/r/f6c823/32.png) [@rvn](https://forum.opensearch.org/u/rvn)\
**Post date:** [September 17, 2024, 8:01pm UTC](https://forum.opensearch.org/t/need-some-help-with-ism-policy/21506/1 "2024-09-17T20:01:44Z")

</div>

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

OpenSearch 2.13

**Describe the issue** :

We currently have new indices created everyday, with the date suffix, and there is a migration policy based on time. How to add another component to this policy, which is rollover, based on sizes

How can I change index template and ISM Policy to handle this feature?

creates an index with a size limit of 70GB. Once the index reaches the limit, a new index should be created with the same date followed by an incrementing suffix (e.g., `http-2024-09-16`, `http-2024-09-16-1`, `http-2024-09-16-2`). This should continue for each new index once the size limit is reached."

**Configuration** :  
ISM Policy:

{  
“policy\_id”: “http-indices-policy”,  
“description”: “Move http indices to warm and Delete after 180 days from cold.”,  
“last\_updated\_time”: 1706223240662,  
“schema\_version”: 19,  
“error\_notification”: null,  
“default\_state”: “http-indices”,  
“states”: [  
{  
“name”: “http-indices”,  
“actions”: ,  
“transitions”: [  
{  
“state\_name”: “warm-http-indices”,  
“conditions”: {  
“min\_index\_age”: “3d”  
}  
}  
]  
},  
{  
“name”: “warm-http-indices”,  
“actions”: [  
{  
“timeout”: “24h”,  
“retry”: {  
“count”: 5,  
“backoff”: “exponential”,  
“delay”: “1h”  
},  
“warm\_migration”: {}  
}  
],  
“transitions”: [  
{  
“state\_name”: “cold-http-indices”,  
“conditions”: {  
“min\_index\_age”: “23d”  
}  
}  
]  
},  
{  
“name”: “cold-http-indices”,  
“actions”: [  
{  
“timeout”: “24h”,  
“retry”: {  
“count”: 5,  
“backoff”: “exponential”,  
“delay”: “1h”  
},  
“cold\_migration”: {  
“start\_time”: null,  
“end\_time”: null,  
“timestamp\_field”: “@timestamp”,  
“ignore”: “none”  
}  
}  
],  
“transitions”: [  
{  
“state\_name”: “delete-http-indices”,  
“conditions”: {  
“min\_index\_age”: “206d”  
}  
}  
]  
},  
{  
“name”: “delete-http-indices”,  
“actions”: [  
{  
“timeout”: “24h”,  
“retry”: {  
“count”: 5,  
“backoff”: “exponential”,  
“delay”: “1h”  
},  
“cold\_delete”: {}  
}  
],  
“transitions”:   
}  
],  
“ism\_template”: [  
{  
“index\_patterns”: [  
“http-_",  
"fluentbit-osi-http-_”  
],  
“priority”: 0,  
“last\_updated\_time”: 1648182660976  
}  
]  
}

IndexTemplate Settings:  
{  
“fluentbit-osi-http-2024.09.16”: {  
“settings”: {  
“index”: {  
“replication”: {  
“type”: “DOCUMENT”  
},  
“codec”: “best\_compression”,  
“mapping”: {  
“ignore\_malformed”: “true”  
},  
“refresh\_interval”: “45s”,  
“number\_of\_shards”: “45”,  
“provided\_name”: “fluentbit-osi-http-2024.09.16”,  
“creation\_date”: “1726444800546”,  
“number\_of\_replicas”: “1”,  
“uuid”: “17zHCD2JRfKnFRh6iZt24A”,  
“version”: {  
“created”: “136347827”  
}  
}  
}  
}  
}

**Relevant Logs or Screenshots** :

---

<div class="post-metadata">

**Author:** ![Mantas](https://avatars.discourse-cdn.com/v4/letter/m/7bcc69/32.png) [@Mantas](https://forum.opensearch.org/u/Mantas)\
**Post date:** [September 18, 2024, 11:22am UTC](https://forum.opensearch.org/t/need-some-help-with-ism-policy/21506/2 "2024-09-18T11:22:17Z")

</div>

Hi @rvn,

If I got it correctly, you just add a rollover action to your ISM policy:

i.e.:

```auto
"actions": [
  {
    "rollover": {
      "min_size": "70gb"
    }
  }
]

```

it would look something like:

```auto
{
  "name": "http-indices",
  "actions": [
    {
      "rollover": {
        "min_size": "70gb"
      }
    }
  ],
  "transitions": [
    {
      "state_name": "warm-http-indices",
      "conditions": {
        "min_index_age": "3d"
      }
    }
  ]
}

```

See more here: [Policies - OpenSearch Documentation](https://opensearch.org/docs/latest/im-plugin/ism/policies/#rollover)

Best,  
mj
