How to update Mulitple Documents of an index using logstash?

Hi all,
I want to update multiple documents when I get a log with the status "FILE_PROCESSING_ERROR". I have set document ids. I have also stored some relevant ids.
In the output plugin I have done something like this to update status field in my document:

if [status] == "FILE_PROCESSING_ERROR"
  {
  #elasticsearch port 9200                
    elasticsearch 
    { 
      hosts => ["localhost:9200"] 
      index => "timeline-%{+YYYY-MM-dd}" 
      action => "update"
      doc_as_upsert => true
      script_lang => "painless"
      script_type => "inline"
      script => 'ctx._source.status = "Order Failed"'
      document_id => "ODW1873109"    
    }
  }

where "ODW1873109" is the document id which I have stored.Please suggest me any way to get it done. I want something like this:

 ruby
    {
     code => " for i in 0..5
     {
      elasticsearch 
      { 
       # update all the logs with documents ids stored in map
      }
     }
   }

Basically, multiple documents of logs need to be updated in my case.

Any help will be really appreciated in this matter. Thanks in anticipation!

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