Is there a way to stop watcher sending alerts after the first one?
so it only send alerts for new errors.
I tried adding a second conditions so its not only just checking for a payload grater than 1 but for ctx.execution_time < now-15s.
But the watcher doesn't like it when I try to add two conditions. Maybe I'm doing it wrong do I need to add a Boolean?
Time throttling does not work in this situation. Below is my watcher.
{
"trigger": {
"schedule": {
"interval": "10s"
}
},
"input": {
"search": {
"request": {
"search_type": "query_then_fetch",
"indices": [
"filebeat-*"
],
"types": [],
"body": {
"query": {
"bool": {
"must": [
{
"range": {
"@timestamp": {
"gte": "now-15s"
}
}
},
{
"match": {
"source": "/foo/bar"
}
},
{
"match": {
"foos": "foo"
}
},
{
"match": {
"foo": "foo"
}
},
{
"match": {
"foo": "foo"
}
}
]
}
}
}
}
}
},
"condition": {
"compare": {
"ctx.payload.hits.total": {
"gt": 1
}
}
},
"actions": {
"notify-slack": {
"throttle_period_in_millis": 2000,
"wmail": {
"message": {
"to": [
"foo"
],
"text": "foofoofoofoofoofoofoofoofoofoovfoofoofoofoofoofoo"
}
}
}
}
}