Skip to content

[BUG] Validation-Error: collision of indexpatterns with differences after a wildcard #837

@micha558

Description

@micha558

(initially posted as opendistro-for-elasticsearch/index-management#446)

Describe the bug
We have indexes named app-test-*-some-* and app-test-*-some_other-*
Therefore we create two indexpatterns which should be clearly distinguishable.

Unfortunately this does not work as the patterns are supposed to not be unique

But the patterns are clearly distinguisable in my eyes because of the character after 'some' (underscore vs. dash)

It seems that this is not only when a difference is between underscore and dash but that only the part before the first wildcard is checked:

Other plugins installed
Opendistro 1.13.2 without only the standard plugins

To Reproduce
Steps to reproduce the behavior:

  1. Go to Dev-Tools and send the request 1:
PUT /_index_template/app-test-some-
{
  "index_patterns": ["app-test-*-some-*" ]
}
  1. Go to Dev-Tools and send the request 2:
PUT /_index_template/app-test-some_other-
{
  "index_patterns": ["app-test-*-some_other-*" ]
}
  1. This gives error:
{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "index template [app-test-some_other-] has index patterns [app-test-*-some_other-*] matching patterns from existing templates [app-test-some-] with patterns (app-test-some- => [app-test-*-some-*]) that have the same priority [0], multiple index templates may not match during index creation, please use a different priority"
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "index template [app-test-some_other-] has index patterns [app-test-*-some_other-*] matching patterns from existing templates [app-test-some-] with patterns (app-test-some- => [app-test-*-some-*]) that have the same priority [0], multiple index templates may not match during index creation, please use a different priority"
  },
  "status" : 400
}

also:

'''
PUT /_index_template/app-test-some_other-
{
"index_patterns": ["app-test--completedifferent-" ]
}
'''
gives this error

Expected behavior
The patterns should be both accepted as a dash and an underscore are two different characters. Parts after a wildcard should be respected

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):
Browser, curl and Python-Http-call (problem not client related)

Additional context
This worked using the old api (_template) in previous version (1.12 ?)

Metadata

Metadata

Assignees

Labels

IndexingIndexing, Bulk Indexing and anything related to indexingfeatureNew feature or requestgood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions