Input Elasticsearch Query in logstash

Hello! I would like to use a query filtering these parameters in logstash's elasticsearch input>

host.raw = host 1 OR host 2
code != "123"

How could I do the query? I have been trying several things for a while without success
ES version is 1.7.1

elasticsearch {
query => '{ "query": .... }'

The queries need to be in this style -

1 Like