Delete documents in Elasticsearch from Logstash

I have an index in Elasticsearch where the UID is automatically generated, I want to delete documents by query but from Logstash. I am trying different ways like http output plugin, is it the correct option to do so? or Is there any other ways to do it from Logstash?
'input {

stdin {
type => "foo"
}
}

output {
http {
url => "*****/test_ind/_delete_by_query?conflicts=proceed"
http_method => "post"
format => "message"
content_type => "application/json; charset=UTF-8"
message => '{"query": { "match_all": {}}}'
headers => {"Authorization" => "ApiKey ****************************************"}
ssl_supported_protocols => "['TLSv1.2', 'TLSv1.3', 'TLSv1.1']"

}

}'

I suppose using http output plugin is a good option.
Is there any problem?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.