Skip to content

[7.x] Templates match indices with date math expressions (#71433)#71957

Merged
danhermann merged 2 commits intoelastic:7.xfrom
danhermann:backport_7x_71433_templates_and_date_math
Apr 20, 2021
Merged

[7.x] Templates match indices with date math expressions (#71433)#71957
danhermann merged 2 commits intoelastic:7.xfrom
danhermann:backport_7x_71433_templates_and_date_math

Conversation

@danhermann
Copy link
Copy Markdown
Contributor

The root cause of the bug identified in #69727 (reported independently by several users) is that the findV?Templates methods in MetadataIndexTemplateService do not resolve index names with date math expressions before attempting to match them. The reproduction scenario in #69727 demonstrates one flavor of this problem. Before 7.9, an ingest pipeline with a date_index_name processor would (accidentally) work around that problem, but the simple statement below would fail to execute the final pipeline in any ES version (assuming a template that defines a final pipeline for an index pattern of test-*):

# url-encoded form of <test-{now/d}>
POST /%3Ctest-%7Bnow%2Fd%7D%3E/_doc 
{
  "field": "value"
}

A change to the way ingest pipelines work in 7.9 caused the date_index_name scenario to fail as well. This change resolves both problems.

Fixes #69727.

Backport of #71433

@danhermann danhermann added >bug :Distributed/Ingest Node Execution or management of Ingest Pipelines backport v7.13.0 labels Apr 20, 2021
@elasticmachine elasticmachine added the Team:Data Management (obsolete) DO NOT USE. This team no longer exists. label Apr 20, 2021
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-core-features (Team:Core/Features)

@danhermann danhermann merged commit 87581ba into elastic:7.x Apr 20, 2021
@danhermann danhermann deleted the backport_7x_71433_templates_and_date_math branch April 20, 2021 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport >bug :Distributed/Ingest Node Execution or management of Ingest Pipelines Team:Data Management (obsolete) DO NOT USE. This team no longer exists. v7.13.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants