Если добавляю эту опцию к template который указываю в template_name в output { elasticsearch { template_name => "haproxy" } }, то она просто пропадает.
И в GET /_template/haproxy вижу:
"aliases" : {
"haproxy" : { }
}
Хотя в PUT /_template/haproxy четко указал:
"aliases" : {
"haproxy" : {
"is_write_index": true
}
}
Как добавить эту опцию чтобы ILM не ругался на
illegal_argument_exception: source alias [haproxy] does not point to a write index
Но индексы каждый час создает logstash, назначать alias там возможности нет, есть только такой функционал:
output {
elasticsearch {
ilm_rollover_alias => "custom"
ilm_pattern => "000001"
ilm_policy => "custom_policy"
}
}
У меня конфигурация такая:
output {
elasticsearch {
id => "HAP Out"
hosts =>
user => ""
password => ""
index => "haproxy-%{+YYYY.MM.dd-HH}"
template_name => "haproxy"
}
Что тогда в ilm_pattern прописать?
ILM rollover phase will move the is_write_alias to the new index at rollover. To get started, the first index needs to exist and have is_write_alias: true. Use a POST like this to update the latest haproxy index with the is_write_alias.
It's a frequent confusion getting ILM working for the first time in more complex configurations, but once it works, you will see that there are many different ways to configure ILM.
After creating the "haproxy-000001" index that has the is_write_alias: true, the output below should work. You will point to the alias, the index where is_write_alias is true will get the output. Only one is allowed and it will move to haproxy-000002 at rollover.
output {
elasticsearch {
id => "HAP Out"
hosts =>
user => ""
password => ""
index => "haproxy"
ilm_enabled => true
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.