I deleted all old os-linux-* indices, stopped Logstash, ran the above command, then restarted Logstash but still same "illegal_argument_exception: setting [index.lifecycle.rollover_alias] for index [os-linux-2024.01.23] is empty or not defined"
I Can't tell you why the others because you haven't showed me all the information.
You haven't showed me enough of the template to show what indices it matches.
But I can tell you without a doubt. Absolutely certainty that when you create an alias for ILM purposes you need to write to the alias, not the concrete index if you want ILM to work
Did you carefully read the docs I linked
Do these match the index pattern in the template.
In short, those indices that you put the date on the end are daily indices. They are not managed by ILM
index_patterns
(Required, array of strings) Array of wildcard expressions used to match the names of indices during creation.
Without that the created index will not match the template and thus the ILM or anything else will not be applied. I an not sure how you even created a template without it
{
"error" : {
"root_cause" : [
{
"type" : "parse_exception",
"reason" : "unknown key [index] in the template "
}
],
"type" : "parse_exception",
"reason" : "unknown key [index] in the template "
},
"status" : 400
}
Any advice?
In create legacy template I just went through the required fields and got the template created (it didn't seem to ask for anything related to an array of wildcard expressions).
PUT _template/os-linux
{
"index_patterns": [
"os-linux-*"
],
"settings": {
"lifecycle": {
"name": "os-linux-policy",
"rollover_alias": "os-linux"
},
"number_of_shards": "1",
"refresh_interval": "5s"
}
}
PUT /%3Cos-linux-%7Bnow%2Fd%7D-000001%3E
{
"aliases": {
"os-linux": {
"is_write_index": true
}
}
}
POST os-linux/_doc
{
"foo" : "bar"
}
# This will be whatever was created by the first command
GET os-linux-2024.01.25-000001
POST os-linux/_rollover
POST os-linux/_doc
{
"foo" : "bar"
}
GET os-linux-*/_search
That particular error was coming from os-linux-2024.01.25 seen in Index Management. Currently it is gone but not sure if it will return when the policy changes phases or something like that.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.