My ilm policy does not work, although I have created a similar one a couple of weeks before in another cluster and it is working just fine..
Here is what I did:
- I pointed Logstash towards ind_alias
- Created index template that will be used for creating the indices (see bellow)
- Bootstrap index with a PUT command (see bellow), but i get an "invalid alias name" error (already exists). It exists because Logstash sends data and so the index is created (so of course it exists! I am wondering how this worked before...)
A desparate next step would be stopping all Logstash (there are many VMs sending so If possible i would prefer to avoid this). And starting from the beginning... But I would like to understand what am i doing wrong
Here are the details
Template:
{
"template": {
"settings": {
"index": {
"lifecycle": {
"name": "Mypolicy",
"rollover_alias": "ind_alias"
},
"number_of_replicas": "1"
}
},
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
},
"@version": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"field3": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"aliases": {
"ind-search-all": {}
}
}
}
ilm:
{
"Mypolicy" : {
"version" : 1,
"modified_date" : "2023-04-26T10:02:14.694Z",
"policy" : {
"phases" : {
"hot" : {
"min_age" : "0ms",
"actions" : {
"rollover" : {
"max_primary_shard_size" : "1gb",
"max_age" : "1d"
},
"set_priority" : {
"priority" : 100
}
}
},
"delete" : {
"min_age" : "30d",
"actions" : {
"delete" : {
"delete_searchable_snapshot" : true
}
}
}
}
},
"in_use_by" : {
"indices" : [
"ind_alias"
],
"data_streams" : [ ],
"composable_templates" : [
"ind_template"
]
}
}
}
Bootstrap command:
PUT ind_alias-000000
{
"aliases": {
"ind_alias": {
"is_write_index": true
}
}
}
This bootstrap command gives the error
{
"error" : {
"root_cause" : [
{
"type" : "invalid_alias_name_exception",
"reason" : "Invalid alias name [ind_alias]: an index or data stream exists with the same name