Update multiple documents using script is not working

Hi All,

I'm trying to update multiple documents using list of document ids by storing their id's in map/list, and then at specific event call "update" for each of that document id.

I've tried following conf code for output elastic plugin

output
{
  #print output on console
  stdout
  {
    codec =>rubydebug
  }
      
  #elasticsearch port 9200                
  elasticsearch 
  { 
    hosts => ["localhost:9200"] 
    document_id => "%{document_id}" 
    index => "jackwillswebsiteorderstimeline-%{+YYYY-MM-dd}" 
  }
  
  if [status] == "FILE_PROCESSING_ERROR"
  {
   elasticsearch 
   {
      hosts => ["localhost:9200"] 
      index => "jackwillswebsiteorderstimeline-%{+YYYY-MM-dd}" 
   action => "update"
   doc_as_upsert => true
   document_id => "G2Q_ORD-0000000-20170917-190205-ODW1873109-2"
   script_lang => "painless"
      script_type => "inline"
   script => 'ctx._source.status = "Order Failed"'
   }
  }
}

Please suggest improvements in my script to achieve what i'm trying.

Thanks

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