I am having trouble setting up a watcher so it looks for a whole term instead of individual words. For example if I had a message that contained "The red hat hung on the hook" and wanted watcher to send an email every time it found the words "red hat". Not "red" or "hat" or "hat red", I only want "red hat". How would I setup the input.
Currently I have something similar to the following:
"input": {
"search": {
"request": {
"indices": [
"red-hat-index-*"
],
"body": {
"query": {
"bool": {
"must": [
{
"query_string": {
"query": "red hat"
}
},
{
"range": {
"@timestamp": {
"gte": "now-10m"
}
}
}
]
}
},
"_source": [
"message"
],
"sort": [
{
"@timestamp": {
"order": "desc"
}
}
]
}
}
}
}
What am I missing in this input??
Bonus question, what if I wanted to find all messages with "red hat", but only the ones where the field "type" is equal to "red_hat_logs"?
Thanks!