title: Logstash : Trigger python script from inout or putput section
body: <p>I have logstash and elasticsearch working and gets data from filebeats from different server.
  I have a requirement where I want to execute a python script when a field is equal to certain value. for example if ([response] =~ /^5\d\d/) {}. i.e., when there are 500 error in log I want to execute a python script for further actions. </p>
  
  <p>I have searched google , elasticforums and I have tried following but no luck so far.</p>
  
  <p>I used output exec plugin to execute the code</p>
  
  <pre><code>exec{command=&gt; "/usr/bin/python3.6 /home/xxxx/xxxx.py %{message}"}
  </code></pre>
  
  <p>I see empty lines as output in the logstash log.
  please note that when I run </p>
  
  <pre><code>exec{command=&gt; "echo %{message}"} 
  </code></pre>
  
  <p>I can see output . But I cannot execute above python script.</p>
  
  <p>I tried to use ruby code in input filters</p>
  
  <pre><code>filter{
      ruby{
          code =&gt; 'require "open3"
          message = event.get("message")
          cmd =  "python3.6 /home/xxxx/xxxx.py  #{message}"
          puts "some text"
          puts #{message}
  
          '
      }
  }
  </code></pre>
  
  <p>No luck with it. Appreciate if anyone can help with this issue.</p>
  
  <p>Thanks,
  Kiran</p>