尝试基于 logstash 查询配置警报
这是我的简化配置:
logstashElasticHosts = http://<url>:9200
alert logstash.errorrate.exceeds1 {
template = generic
$notes = "The rate of errors in 5 sec exceeds 1."
$lastday = lscount("prod", "level:ERROR", "level:ERROR", "5s", "10m", "")
$lastDayMax = max($lastday)
warn = $lastDayMax > 1
warnNotification = email
}
在 bosun/config 页面上测试警报时,我既没有收到正常结果,也没有收到警告结果:
criticals: 0, warnings: 0, normals: 0, errors: 0
那么我做错了什么?(弹性工作正常。我已经检查过 Kibana UI。)