If the leave_id
field is the primary key, you can use as doc_id. If is not, then you should use fingerprint. Check the similar topic.
output {
elasticsearch {
hosts => ["http://localhost:9200"]
user => "elastic"
index => "index_mxcel_patient_leaves"
document_id => "%{leave_id}"
doc_as_upsert => true
}