-
Notifications
You must be signed in to change notification settings - Fork 25k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expand template "index_pattern" matching to allow negative matching #62681
Comments
@simozanin Is your intention only to exclude what we call hidden indices (usually indices that start with .)? If yes, this feature is already implemented from 7.7, where you can mark you index as hidden, and it will be excluded from a wildcard extension operation, one of which is global index template. |
Pinging @elastic/es-core-infra (:Core/Infra/Core) |
Hi, Yes, that is very helpful actually, and should solve my problem. However, I have encountered an issue before where my template was applied to some of the hidden indices and prevented Kibana from starting-up properly, please see log attached. I have again set the template with the usual PUT request, this is the output of
As you can see below, this template is applied to the index .kibana as well:
Is it worth opening an bug fix request for this? Or is this expected behaviour? |
While the feature about exclusion/inclusion of patterns might be interesting, I want to comment about the specific issue you're facing with Kibana. At the moment, the system indices are not implemented, so Kibana can still be affected by index templates. |
Looking at the kibana upgrade docs it says to "narrow down index patterns" We have many indices which contain different type of documents but themselves are very small (<1 gig per day) I also can't mark those indices as hidden since the monitoring indices are created each day Is there no way to create a default ILM? |
Following from this discussion: https://discuss.elastic.co/t/template-index-pattern-matching/249289
And this: https://discuss.elastic.co/t/defining-index-mappings-on-elasticsearch/248774/6
It would be helpful to add a way to define templates on all new indices in ES, except those matching a condition. Right now the only way to do this is to use wildcard matching, which is quite difficult to apply in real-case scenarios.
Let's say I want to store documents that represent movies in my ElasticSearch engine, and I want to store each movie in a different index for each production company. I would have indices for warnerbros, disney, 20thcentury, etc. I know I won't store any other kind of object in my engine, so I want all indices to share the same mapping. So it would make sense to define a template right after spinning up the ElasticSearch instance, so that any new index created when indexing a document has the mappings defined in my template.
Right now I have two ways of doing this:
"index_patterns": ["m-*"]
"index_patterns": ["warnerbros", "disney", "..."]
The first solution is not very practical, it forces me to manipulate the index name, and if I want to infer the index name automatically from the contents of my documents this won't work. The other solution is tedious and won't scale well if I need to add new productions companies that didn't previously exist.
Using a pattern matching with just the wildcard, i.e.
"index_patterns": ["*"]
, causes problems with the .log* and .metrics* indices, and if I define an alias in the template then it applies to any new index created, including logs and metrics.My suggestion is to allow negative matching, so that I can define a template on all new indices that do not match a certain pattern. This way I could exclude the logs and metrics indices from the template. Something along the lines of:
The text was updated successfully, but these errors were encountered: