- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经用我的 elasticsearch 主机配置了 elastalert 实例。我还创建了一个示例规则,它将在日志中匹配该模式时检查日志级别和警报。
一切正常,我在我的 Slack channel 上正确收到警报。
唯一关心的是我收到的警报中的信息/数据。 elastalert 插件正在发送与我正在寻找的模式相关的所有属性;但我对所有信息都不感兴趣。我只关心一些特定的属性。
这是我的规则示例:
# Alert when the rate of events exceeds a threshold
# (Optional)
# Elasticsearch host
es_host:
# (Optional)
# Elasticsearch port
es_port:
# (OptionaL) Connect with SSL to elasticsearch
#use_ssl: True
# (Optional) basic-auth username and password for elasticsearch
#es_username: someusername
#es_password: somepassword
# (Required)
# Rule name, must be unique
name: DB2 test Rule
# (Required)
# Type of alert.
# the frequency rule type alerts when num_events events occur with timeframe time
type: frequency
# (Required)
# Index to search, wildcard supported
index: logstash-* # logstash-2016.04.05 #logstash-YYYY.MM.DD # logstash-*
# (Required, frequency specific)
# Alert when this many documents matching the query occur within a timeframe
num_events: 1
# (Required, frequency specific)
# num_events must occur within this amount of time to trigger an alert
timeframe:
hours: 12
# (Required)
# A list of elasticsearch filters used for find events
# These filters are joined with AND and nested in a filtered query
# For more info: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html
filter:
- query:
query_string:
query: "type: db2 AND logLevel: Warning"
# (Required)
# The alert is use when a match is found
alert:
- "slack"
slack:
slack_webhook_url: "XYZ"
我在 Slack channel 上收到的警报如下所示:
DB2 test Rule
DB2 test Rule
At least 1 events occurred between 2016-04-29 07:51 UTC and 2016-04-29 19:51 UTC
@timestamp: 2016-04-29T19:51:45.940Z
@version: 1
_id:
_index: logstash-2016.04.29
_type: db2
apphdl:
appid:
authid:
day: 29
db: NEO
eduid:
eduname:
function:
host:
hostname:
hour: 14
id:
instance:
logLevel: Warning
logMessage:
LOADID:
DATA #2 :
Completed
message: LEVEL: Warning
和 ETC ETC...
我想自定义此警报消息,以便它只用我关心的那些属性来提醒我。(例如时间线、日志级别和更多。)
有办法吗?非常感谢您提供一点帮助或指导。
最佳答案
根据ElastAlert documentation ,您可以使用 include
将警报限制为仅包含文档中的某些字段。
在您的情况下,它将是:
include: ["@timestamp", "logLevel", "message"]
关于elasticsearch - 自定义 Elasticsearch 的 elastalert 插件收到的警报中的信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36947201/
我写了下面的规则 type: frequency filter: - query: query_string: query: "category:foo.bar AND msg._
我们使用 ElastAlert 来提醒 Elasticsearch 数据,我们有很多规则。现在,其中一些规则仅在工作时间(如工作日)内运行才有意义,我们希望定义规则应该作为规则本身的一部分运行的时间段
我正在为心跳编写 Elastalart 规则,即如果服务或机器停机,我应该得到通知。现在我可以为每个文件创建一个服务规则,如下所示。 name: My Alert type: frequency in
我关注了this url安装 Elastalert,但是我什至不知道 config.yaml.example 文件在哪里。 elastalert 默认安装在哪里?我错过了什么吗? 最佳答案 https
我在 aws 上设置了 elastalert,我可以使用命令 python -m elastalert.elastalert --verbose --rule example_rules/exampl
我在 elastalert 中有一条规则,如果两小时内没有付款,则会发送通知。 我还有一个匹配增强功能,每晚从 0:00 到 8:00 AM 都会删除这些通知: from elastalert.enh
尝试使用端口:5601 使用elastalert-create-index命令为基本身份验证 protected 实例使用Elastalert创建索引时,它失败并显示以下错误: elasticsear
elastalert是否可以在匹配查询的所有文档的某个字段之和超过某个值时触发?假设每个文档都有一个“价格”值 - 例如,当最后一天的“价格”值之和超过 200 时,是否可以触发 elastalert
我正在使用 metricbeat 监控磁盘空间使用情况。 现在我想根据磁盘大小通过 Elastalert 发出警报。 当磁盘空间使用超过 50% 时发出警报 当磁盘空间使用超过 70% 时发出警报 当
看起来自 2020 年以来 elastalert 在导入时失败 日志说:不能从时间导入单调 最佳答案 Elastalert 不固定“stomp”库版本,“stomp”发布了一个不支持 python2
我已经用我的 elasticsearch 主机配置了 elastalert 实例。我还创建了一个示例规则,它将在日志中匹配该模式时检查日志级别和警报。 一切正常,我在我的 Slack channel
我是一名优秀的程序员,十分优秀!