Alias not applying on Index which gets created daily


(Yashodhara) #1

I am trying not to create alias manually for my indexes which get created every day, by mentioning alias in my template

{
"xxx_test": {
"order": 0,
"template": "xxx_test*",
"settings": {
"index": {
"number_of_shards": "5",
"number_of_replicas": "0"
}
},
"mappings": {
"xxx_test": {
"dynamic": "true",
"dynamic_templates": [
{
"index_name": {
"mapping": {
"index": "not_analyzed"
},
"match_mapping_type": "",
"match": "
"
}
}
],
"properties": {
"@timestamp": {
"format": "strict_date_optional_time||epoch_millis",
"type": "date"
},
"Value": {
"type": "double"
},
"Timestamp": {
"format": "strict_date_optional_time||epoch_millis||date_hour_minute_second_millis||yyyy-MM-dd HH:mm:ss,SSS",
"type": "date"
}
}
}
},
"aliases": {
xxx_test: {}
}
}

This gives error as one alias cannot represent multiple indices.

How to dynamically create alias for the index which gets created per day.
Eg

Index day 1 - abc_20170811
Index day2 - abc_20170812
Index day3 - abc_20170813

I want the Index alias to be "abc".


(system) #2

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