Policy for delete indices

hi :slight_smile: how can I run policy every hour to delete indices that are older than a week?
I did this just to delete after a week but I want this to run every hour:
{
“policy”: {
“description”: “Delete Indices after 7 days.”,
“default_state”: “default”,
“states”: [
{
“name”: “default”,
“actions”: ,
“transitions”: [
{
“state_name”: “delete”,
“conditions”: {
“min_index_age”: “7d”
}
}
]
},
{
“name”: “delete”,
“actions”: [
{
“delete”: {}
}
],
“transitions”:
}
],
“ism_template”: [
{
“index_patterns”: [
“index-*”
],
“priority”: 100
}
]
}
}

Hey @taltsafrir

I dont under stand why you want to run it every hour, If it delete index set after 7 Days.

Maybe it’s about how often the job for checking should run? That defaults to 5 minutes, but it can be changed via plugins.index_state_management.job_interval, see Settings - OpenSearch documentation

1 Like

yes I meant how often for checking should run :slight_smile:
thanks!

1 Like

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