我不太了解 Elastalert。我只是想知道是否可以在集群状态为 RED 时使用 elastalert 获得通知。
谢谢
这是可能的。但是您需要通过集群运行状况查询来访问它。样本:
input{
exec {
curl -u <username>:<password> <elasticsearch-ip:port>/_cluster/health
codec => rubydebug
type => cluster-health
}
}
output {
if "health" in [type] {
elasticsearch{
index => "cluster-health-%{+YYYY.MM.dd}"
hosts => ["elasticsearch-host:port"]
}
}
}
如果您有未解析的过滤器,请添加带有if [type] == "cluster-health"
部分的过滤器以过滤并将其解析为 json。这为您提供了基本的详细信息。尽管您可能需要更新状态的字段映射.. 至少我面临问题并且您随时可用。现在你可以像往常一样使用 elastalert 了。
看起来他们还没有开箱即用的功能。但是有一些 hacky 方法可以实现它https://github.com/Yelp/elastalert/issues/903 他们建议改用 Marvel。