Currently i am in the process of migrating our ELK instance from manual index deletion to using ILM policy, however filebeat is sending logs to logstash but the following error is shown in the logs of logstash.
[2021-05-12T13:30:21,465][INFO ][logstash.outputs.elasticsearch][main][302547529675efa56b2617eeccc5f5889126d8038c3689d20a6facb0b903bd9a] retrying failed action with response code: 500 ({"type"=>"illegal_state_exception", "reason"=>"alias [filebeat_alias] has more than one write index [filebeat-2021.05.12-000001,filebeat-2021.05.10]"})
i have done the following steps:
Stop ILM POST /_ilm/stop
Removed all old index from index management -> indices
Add new index using date math PUT %filebeat-%7Bnow%2Fd%7D-000001%3E
Update the alias to correct the write_alias pointer POST /_aliases { "actions" : [ { "add" : { "index" : "filebeat-2021.05.12-000001", "alias" : "filebeat_alias", "is_write_index" : true } } ] }
Start ILM POST /_ilm/start
I created a policy before step 1 with the name "filebeat_policy"
i tried it without the filebeat-2021.05.12-000001 but it indexes only one date and gives the next error: illegal_argument_exception: index name [filebeat-2021.05.11] does not match pattern ‘^.*-\d+$’
Could someone help me a step further? or point me in the right direction.
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
green open filebeat-2021.05.12-000001 zLNHmhfZQ72HZztjyUpzTg 1 0 0 0 208b 208b
For future note when searched, this is now answered in the blog Troubleshooting ILM blog & direct summarized discussed error resolutions are:
alias [x] has more than one write index [y,z]
When you run Get Aliases, you’ll notice that two indices are marked as is_write_index:true when only one should be per alias. You’ll want to toggle is_write_index:false on one of the indices via the Aliases API.
index name [x] does not match pattern *^.*-\d+
The index name’s regex pattern matching is a prerequisite for rollover to work. The most common implication users miss is not realizing the index name needs to end with trailing digits, e.g. my-index-000001 and instead only use my-index which does match the pattern requirement. Here’s an example Elastic Discuss issue. You may consider Data Streams which handle this for you.
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.