Can i create aliases with month and year in index templates?


i have to create alias with indexname,month and year.

  "template": data-*",
  "settings": {
    "number_of_shards": 1
  "aliases": {
    "my_index-%{year}-%{month}": {}

When the i tried above template it is creating alias with exact string i specified(i.e.my_index-%{year}-%{month}) rather than printing year and month (i.e data-2017-03) .

FYI - My index is in the format data-2017-03-25 .

IS it possible to create dynamic alias in index templates?


My original answer here hasn't changed. Also, please don't post the same thing multiple times.