ILM policy for a index which only delets 30 days data without deleting the index please check the below policy is write or wrong?

please any one can check the code is write according to this situation
PUT _ilm/policy/my_policy
{
"policy": {
"phases": {
"hot": {
"actions": {
"rollover": {
"max_age": "30d"
}
}
},
"delete": {
"min_age": "30d",
"actions": {
"delete": {}
}
}
}
}
Provide a index pattern to the index
PUT my_index
{
"settings": {
"index.lifecycle.name": "my_policy"
}
}
its only contain 2 stages hot and delete

Hello there @Bibhudutta_Mohanty
I'll try this too.
What versions of elastic and kibana are you running?

Am I correct in thinking that you wish to keep using the same index and completely remove the data older than 30 days?

I usually (for metrics data) use a data stream instead of a regular index. If you are not using metrics data, then pls disregard. With a data stream and ILM policy you'd we essentially writing to an alias (so to speak) and then the policy will automatically create the backing indices for you. In fact, I normally dont need to know the backing indice names.

Data streams | Elasticsearch Guide [7.13] | Elastic

Hi Tre_Seymour,

"version" : {
"distribution" : "opensearch",
"number" : "2.4.1",
"build_type" : "tar"

yes your assumption is right, wish to keep using the same index and completely remove the data older than 30 days. its a timeseries log data so i need a proper ilm policy which can delete only 30 days old log data without deleting the index.

i want your suggestion if i need one rollover policy?

OpenSearch/OpenDistro are AWS run products and differ from the original Elasticsearch and Kibana products that Elastic builds and maintains. You may need to contact them directly for further assistance.

(This is an automated response from your friendly Elastic bot. Please report this post if you have any suggestions or concerns :elasticheart: )

ILM is an Elasticsearch only feature, you will need to ask aws directly what opensearch uses there.

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