It would be very similar to this example except you will need 2 must clauses - one for event_id and another one for keyword. The actual query would depend on how event_id and keyword are mapped. Assuming that they have integer and keyword types something like this might work:
You will also need to change condition to match 4 hits instead of 0. If this doesn't work for you, please show the complete watch that doesn't work together with index mapping and some sample record.
I fixed it, in case anyone is interested. My use case here is to grab Kerberos authentications logs from our DC and alert on potential brute force attacks. This search will match documents from the last 5 minutes with the following criteria:
Keyword field matching "Audit Failure"
The name of the AD Server, "AD1"
The Windows event ID for authentication attempt, "4776"
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.