Templates matching specific date patterns

I have day-wise indices that are named like prefix-yyyy-mm-dd e.g myindex-2020-10-01, myindex-2020-10-02 and so on. I want to re-index them into monthly indices named prefix-yyyy-mm e.g. myindex-2020-10, myindex-2020-09 and so on.

If I have an existing template that has the pattern myindex-*, is there a way to alter the pattern so that it matches only the monthly indices?
E.g. current

"order" : 0,
"index_patterns" : [
      "myindex-*"
],

to something like

"order": 1,
"index_patterns" : [
      "myindex-yyyy-mm"
],

Does this work? So that the former continues to match day-wise indices and latter matches only monthly indices?

The pattern matching is wildcard only, you can't use regex style patterns unfortunately.

1 Like

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