【问题标题】:Elastalert : Cluster health notificationElastalert:集群健康通知
【发布时间】:2016-10-19 10:31:03
【问题描述】:

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

谢谢

【问题讨论】:

  • 如果您将 Elasticsearch 的日志提取到 Elasticsearch 本身,我敢打赌,您可以编写一条规则来查询这些日志,以便在集群状态为红色时发出警报。

标签: elastalert


【解决方案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 下工作了。

【讨论】:

    【解决方案2】:

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

    【讨论】:

      【解决方案3】:

      据我所知没有。

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

      目前elasticsearch集群提供健康状态的方式是通过healthapi,所以没有索引可供查询。

      【讨论】:

      • 您是否尝试过使用 logstash elasticsearch 输入插件来运行集群健康查询并使用一些索引名称输出到 Elasicsearch?我认为这将创建健康指数
      猜你喜欢
      • 1970-01-01
      • 2018-04-19
      • 2019-10-25
      • 1970-01-01
      • 2023-04-03
      • 1970-01-01
      • 2021-04-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多