I want to send an alert if a cron job has not run in the last 10 minutes. I set the following up in watcher:
"query": {
"bool": {
"must": [
{
"terms": {
"host.hostname": [
“the “hostname
]
}
},
{
"range": {
"@timestamp": {
"gte": "now-10m"
}
}
}
],
"must_not": {
"match": {
"message": “cron log entry that job ran”
}
},
"filter": {
"term": {
"log.file.path": "/var/log/cron"
}
}
}
},
Once or twice a day I get an alert but the entry is in cron log. any suggestions on how to improve the alert?
Thank you