I'm_Pratik
I'm_Pratik

Reputation: 561

Elasticsearch ILM rollover - Start the index from 00001 for every new date

I have a ILM policy which rollover lets say after "max_docs": 15000. Meaning rollover the index once the docs.count reaches to 15000.

{
    "policy": {
        "phases": {
            "hot": {
                "actions": {
                    "rollover": {
                        "max_docs": 15000
                    }
                }
            },
            "delete": {
                "min_age": "1d",
                "actions": {
                    "delete": {}
                }
            }
        }
    }
}

Rollover is also happening when I bootstrap the initial index index-2022-07-02-00001 and appending the new date for next date to the index like :

index-2022-07-02-00002 
index-2022-08-02-00003
index-2022-08-02-00004

and so.

Now I want to create the new index for each day but the index pattern should also start from 00001 meaning :

index-2022-07-02-00001
index-2022-07-02-00002
index-2022-08-02-00001 - For next day the pattern (00001) should be applied instead of (00003)

Please suggest a way to apply this kind of pattern.

Upvotes: 1

Views: 1080

Answers (1)

Bibi
Bibi

Reputation: 33

I'm sorry but I think this can't be done.

The ILM pattern we have is: ilm_pattern => "{now/d}-00001"

This number is always increased by one, no matter what comes before.

Upvotes: 0

Related Questions