Index templates with more complex name matching


We're in a case that we want to automatically assign aliases to newly created indices. The sole purpose is to point Kibana index patterns to these aliases, and make some kind of layer in case of automatic reindexing process.

I saw in the official documentation that is possible through templates (here).

{ "template" : "te*", ... "aliases" : { "alias1" : {}, "alias2" : { "filter" : { "term" : {"user" : "kimchy" } }, "routing" : "kimchy" }, "{index}-alias" : {} } }

These examples are quite simple.

For matching index name, the wildcard is useful, but is there a way to be more precise by using something like regular expressions?

The use of {index} in aliases creation is very useful, but is it possible to extract only part(s) (regex again) of the original index name when creating aliases?

It is for Elastic Stack logging.
As usual, each indice with the format {index}-YYYY.MM.DD, and only some part of the index name is of interest when creating aliases.

Bruno Lavoie