I use filebeat to add fields to dynamically generate indexes.
index => "%{[service]}-%{+YYYY.MM.dd}"
I configure the following index template to match the generated index
{
"index_templates" : [
{
"name" : "pre-games",
"index_template" : {
"index_patterns" : [
"*_room_pre*"
],
"composed_of" : [
"games-mappings",
"pre-games-settings"
],
"priority" : 112,
"version" : 1
}
}
]
}
{
"component_templates" : [
{
"name" : "pre-games-settings",
"component_template" : {
"template" : {
"settings" : {
"index" : {
"lifecycle" : {
"name" : "pre",
"rollover_alias" : "*_room_pre*"
},
"routing" : {
"allocation" : {
"require" : {
"box_type" : "hot"
}
}
},
"number_of_shards" : "3",
"number_of_replicas" : "1"
}
}
},
"version" : 1
}
}
]
}
When I configured the index lifecycle policy, I encountered a problem:
Normally, an index corresponds to an alias, which should be at the beginning of the index name. But my index template generates index names of different businesses, such as mysql_ room_ pre-2020-04-28; tomcat_ room_ pre-2020-04-28。 If every business needs to generate an index template, then I
I've tried the following method to match index names of different businesses, but it doesn't work
"rollover_alias" : "*_room_pre*"