Contents

Elasticsearch Provided Name and ILM

Contents

As I was learning a little about ElasticSearch’s ILM (Index Lifecycle Management) feature, I ran across a parameter called provided_name when examining an index.

A bit of searching turned up the this Github issue, but it doesn’t really explain where it comes from.

A bit more searching led me here.

So provided_name is a method of templating index names it seems, using date math as explained in the documentation.

Just make sure to HTML encode the index name, as per the example from the documentation:

# PUT /<my-index-{now/d}>
curl -X PUT "localhost:9200/%3Cmy-index-%7Bnow%2Fd%7D%3E"

However, using this with ILM requires 1 more thing, a 6 digit zero-padded number on the end of the index name.

# PUT /<my-index-{now/d}-000001>
curl -X PUT "localhost:9200/%3Cmy-index-%7Bnow%2Fd%7D-000001%3E

This templating is then used by ILM so that whenever ILM creates a new index, it will be timestamped based on the provided_name and numbered sequentially. In the case of the example above, if ILM created a new my-index-<date>-<number> today (June 4th, 2020), the index name would be my-index-20200604-000056, if this index was the 56th sequential index created in the series.

References