Dynamic alias creation via template

Hi,

I have indices created by users, where the index name always matches the pattern "xyz.helloworld" (the variable part is xyz)

Is there a way to use a template to automatically create an alias xyz for "xyz.helloworld"?

For example,

abc.helloworld should have alias abc
test.helloworld should have alias test
anothertest.helloworld should have alias anothertest

Hi @Ennui,

After a quick search I found this issue on github that maybe match with what you looking for:

But the issue is closed.

One solution is when you create the index you can use the "_seq_no" field from the elastic response to understand that the index is created and assign your alias.

if _seq_no = 0:
set_alias()

Thanks @gabriel_tessier for the alternative solution. Yes I saw that github thread but was hoping that there would be some updates since it was closed a long while ago.

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