Open rebron1900 opened 10 months ago
得看一下实现了,时间太久我有点忘记了
得看一下实现了,时间太久我有点忘记了
期待答复😁
样本数据: { "receiver": "webhook", "status": "firing", "alerts": [ { "status": "firing", "labels": { "alertname": "ServicePortUnavailable", "group": "elasticsearch", "instance": "192.168.10.55:9200", "job": "blackbox_exporter_tcp", "severity": "warning", "team": "elk" }, "annotations": { "description": "elasticsearch 192.168.10.55:9200 service port is unavailable", "summary": "service port unavailable", "value": "192.168.10.55:9200" }, "startsAt": "2023-07-08T09:16:01.979669601Z", "endsAt": "0001-01-01T00:00:00Z", "generatorURL": "/graph?g0.expr=probe_success%7Binstance%3D~%22%28%5C%5Cd%2B.%29%7B4%7D%5C%5Cd%2B%22%7D+%3D%3D+0&g0.tab=1", "fingerprint": "1e43318d4e7834f1" } ], "groupLabels": { "alertname": "ServicePortUnavailable" }, "commonLabels": { "alertname": "ServicePortUnavailable", "group": "elasticsearch", "instance": "192.168.10.55:9200", "job": "blackbox_exporter_tcp", "severity": "warning", "team": "elk" }, "commonAnnotations": { "description": "elasticsearch 192.168.10.55:9200 service port is unavailable", "summary": "service port unavailable", "value": "192.168.10.55:9200" }, "truncatedAlerts": 0 }
提取规则:
{
"title": "${alerts[0].labels.alertname}",
"description": "${alerts[0].annotations.summary}",
"content": {
"告警等级": "${alerts[0].labels.severity}",
"告警类型": "${alerts[0].labels.alertname}",
"告警主机": "${alerts[0].labels.instance}",
"告警详情": "${alerts[0].annotations.description}",
"告警时间": "${alerts[0].startsAt}",
"恢复时间": "${alerts[0].endsAt}"
},
"url": "${alerts[0].generatorURL}"
}
构建规则
{
"title": "${title}",
"description": "告警简述:${description}",
"content": "详情:\n告警等级:${content.告警等级}\n告警类型:${content.告警类型}\n告警主机:${content.告警主机}\n告警详情:${content.告警详情}\n告警时间:${content.告警时间}\n恢复时间:${content.恢复时间}",
"url": "告警链接:${url}"
}
使用的是飞书群机器人通道: https://xxxxx/webhook/043ecff64e724wec9b1d4f4d56862c7f
报错: { "message": "Webhook 提取规则解析失败", "success": false } 能帮看看哪个地方不对吗?
例行检查
问题描述 经过我的测试,目前在构建规则中只有
content
和description
两个字段可以识别,其他的都不行,即便能成功提交也接收不到数据,请问这个有具体规范吗?artalk样本数据:
我的提取规则
构建规则
复现步骤
预期结果
相关截图 如果没有的话,请删除此节。