Hello,
I needed to update a legacy template to add an alias, but the operation fails (legacy template are deprecated).
I created a set of components to replicate the existing template
then included them in a new index template:
The Request is:
PUT _index_template/tptt_eni_tp_test_new
{
"index_patterns": [
"eni-test-tp*"
],
"composed_of": [
"cptt_eni_test_settings",
"cptt_eni_tp_mapping",
"cptt_eni_tp_aliases"
]
}
but the preview does not contain the aliases from the alias component:
{
"template": {
"settings": {
"index": {
"number_of_shards": "2",
"number_of_replicas": "0"
}
},
"mappings": {
"dynamic_templates": [],
"properties": {
"@timestamp": {
"type": "date"
},
"Attack_Type": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
},
[ ... cut ... ]
"subsidiary": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"uploadTime": {
"type": "date",
"format": "yyyy/MM/dd HH:mm:ss.SSS"
}
}
},
"aliases": {}
}
}
The alias component seems fine:
GET _component_template/cptt_eni_tp_aliases
{
"component_templates" : [
{
"name" : "cptt_eni_tp_aliases",
"component_template" : {
"template" : {
"aliases" : {
"eni-tp-subs-angola" : {
"filter" : {
"term" : {
"subsidiary.keyword" : "angola"
}
}
},
[ ... cut ... ]
"eni-tp-subs-kenya" : {
"filter" : {
"term" : {
"subsidiary.keyword" : "kenya"
}
} } } } } }
]
}
When a document is posted to a new index like eni-test-tp.test-component
the settings and mappings are correct, but it has none of the expected aliases.
The only solution I found is to add the alias section during the index_template creation itself, as the composition seems rejecting the alias component.
Am I doing something wrong?
Regards,
Paolo