How to Update multiple Elastic search Documents from Logstash Output Plugin

My logstash event have a column with array of document IDs to be update - column name :: "listOfDocumentIds".
How to iterate over the array and update multiple documents in elastic search.
Below is the code I used to update one record.

elasticsearch {
hosts => [ "{host-name}:9200" ]
index => "elasticsearchinlogstashindex"
action => "update"
document_id => "%{[listOfDocumentIds][0]}"
script => "ctx._source.callsOverlapped='Yes';"
script_lang => "painless"

Instead of hard coding the index value in the above piece of code - document_id => "%{[listOfDocumentIds][0]}" I need to iterate over the size and update the documents in elastic search.

1 Like

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