Logstash ruby filter and event fields
<p>I am trying to capture IP address field from incoming logstash event and pass it on to a shell script to compare against a static black list. The issue is, I am able to print the IP addr using puts but not able to capture to pass it on to <code>system()</code> call in ruby filter. Here is my sample config.</p>

<p>I am using logstash 2.0</p>

<pre><code>Sample input = {"name":"xyz", "source_ip":"8.8.8.8"}

input {

        stdin {
        codec =&gt; json
        }
}

filter {

        ruby {
        code =&gt; "
        # puts event['source_ip']  # This always works
        ip = event['source_ip']
        system('echo ${ip}')       # This echoes ${ip} instead of value !
        "
        }
}
</code></pre>

<p>I also tried '<code>echo #${ip}</code>' but it just prints <code>0</code>. </p>