1

我不太了解 Elastalert。我只是想知道是否可以在集群状态为 RED 时使用 elastalert 获得通知。

谢谢

4

3 回答 3

1

这是可能的。但是您需要通过集群运行状况查询来访问它。样本:

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 了。

于 2017-05-10T06:41:15.683 回答
1

看起来他们还没有开箱即用的功能。但是有一些 hacky 方法可以实现它https://github.com/Yelp/elastalert/issues/903 他们建议改用 Marvel。

于 2017-11-07T05:54:35.893 回答
-1

据我所知没有。

当前的 Elastalert文档声明 index 字段在规则 .yaml 文件中是必需的。

目前弹性搜索集群提供健康状态的方式是通过healthapi,因此没有索引可用于查询。

于 2016-11-18T21:08:18.010 回答