Elastic + pushplus:Kibana 告警推到微信
效果:Kibana Rule 或 Watcher 触发时,微信收到一条提醒,再回 Discover / Alerting 看上下文。
Kibana Webhook / Watcher 发出的告警 JSON 不会映射为 title / content。直连用 GET 固定文案。
前置条件
- 一个 pushplus token(官网扫码获取)
- Kibana 里能建 Connector / Rule,或能改 Watcher
配置步骤
- Kibana → Stack Management → Connectors → Create connector → Webhook(8.x 也可能在 Rules → Create rule → Actions 里直接加 Webhook)。
- Method 选
GET(或 POST 到带查询串的 URL),URL 填:
https://www.pushplus.plus/send?token=你的token&title=Kibana告警&content=请打开KibanaAlerting查看
- 打开 Stack Management → Rules,创建或编辑规则,Action 选刚建的 Connector。频率建议「仅状态变化时」,避免每次检查都推。
- 使用 Watcher 时,在 Watch 的
actions里加webhook,path/query带上同样的token、title、content。不要把整个ctx.payload当 pushplus 正文 POST 出去。 - 点 Rule 的 Run / Send test。Kibana 节点需能访问
www.pushplus.plus。
需要动态字段时,用可自定义 Body 的 Connector POST JSON(content 必填),或会员 预处理。完整字段见 消息接口。
验证
curl -X POST "https://www.pushplus.plus/send" \
-H "Content-Type: application/json" \
-d '{"token":"你的token","title":"Elastic 配置测试","content":"token 可用","template":"markdown"}'
常见问题
Action 绿了但微信没有? 看 Connector 执行日志的 HTTP 状态,以及额度,见 收不到消息、接口限制。
正文总是固定句? GET 直连就是固定文案。Watcher 的默认 payload 不会变成 content。