Best way to delete ElasticSearch document using Logstash configuration

Please let me know the best practice to delete a record from ES using logstash configuration.

I am currently using this, but it doesn't seem to work fine:

elasticsearch {
document_id => "%{messageID}"
protocol => "http"
host => "orion-mao-devehsreporting1v"
index => "logstash-%{+YYYY.MM}"
action => "delete"
}

Thanks.

Please keep to one thread Logstash to delete document from Elasticsearch :slight_smile: