Logstash Elasticsearch plugin compare inputs

There is an example of using an elasticsearch filter here.