Hi all,
I have a logstash output http plugin:
output {
if [@metadata][index_to_delete] == "first_index" or [@metadata][index_to_delete] == "second_index" {
http {
id => "http_index_delete"
url => "https://HOST:9200/%{[@metadata][index_to_delete]}"
http_method => "delete"
cacert => 'mycert.cer'
user => "user_with_delete_index_right"
password => "mypass"
}
}
}
An I get this error:
[2023-07-11T16:15:03,083][ERROR][logstash.outputs.http ][main][http_index_delete] [HTTP Output Failure] Encountered non-2xx HTTP code 400 {:response_code=>400, :url=>"https://HOST:9200/second_index", :event=>#<LogStash::Event:0x453a6b91>}
It is a bad request to elasticsearch.
How can I solve it? Is it because of credentials? Thank you
Edit: Logstash version 7.17