Template index_pattern matching

How do I ensure that only new indices get my template, and not the metrics or logs indices. If I define the "index_pattern" to be "*" that will apply to all new indices. Is there a way to specify that I don't want to apply the template to indices starting with "."?

The examples for index_pattern are not very helpful, somehow we expect indices that share the same template to start with the same letter, like "t*" etc. In my use case I have a list of more than 30 types of products that I want to share the same settings, and I don't want to add every product type to the index_pattern list. On top of that, I want to be able to use the same template for all the new product types that might be added in the future, since I know that my ES cluster will always contain objects that belong to that category. Is there a way to achieve this, without changing the index name of all products?

So far the only solution I've found is to prepend a string to the index names so that I have them be like "q-abc", "q-xyz" etc. The index pattern matching seems to only allow for wildcard matching, is there a plan to implement something like RegEx or more advanced pattern matching solutions? Even just negating a condition would be helpful, like in my case applying the template to all indices that don't start with "."

Continuing the discussion from Defining index mappings on ElasticSearch:

There's no way to set a "not match" type approach unfortunately.

I'd suggest you create a feature request on GitHub with your ideas :slight_smile:

1 Like

Thanks for your reply, please see: https://github.com/elastic/elasticsearch/issues/62681

@Russ_Cam FYI

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