elk使用微信ElartAlert企业微信告警,自定义告警内容

第一种方式

alert:
- "elastalert_modules.wechat_qiye_alert.WeChatAlerter"

alert_text: "
======start====== 

索引:{}

服务器:{}

接口:{}

告警:

{}"

alert_text_type: alert_text_only

# 企业微信告警的数据不需要太多,太长
alert_text_args:
- _index
- server
- path
- message

#后台登陆后【设置】->【权限管理】->【普通管理组】->【创建并设置通讯录和应用权限】->【CorpID,Secret】
#设置微信企业号的appid
corp_id: wxea4f5f73xxxx
#设置微信企业号的Secret
secret: "xxxxxBGnxxxxxxxxxrBNHxxxxxxxE"
#后台登陆后【应用中心】->【选择应用】->【应用id】
#设置微信企业号应用id
agent_id: 100xxxx
#部门id
party_id: <span class="hljs-number">14
#用户微信号
user_id: "@all"
# 标签id
#tag_id:

注意:如果指定标签名称不存在,会自动通过api创建一个标签(处于锁定状态),需要管理员,手动解锁,并且添加成员 如果指定标签下没有成员(标签添加部门无效),则会根据cp.properties指定的部门idPartyId和人员idUserId进行发送 如果部门下没有成员,而且指定的用户也没有关注该企业号,则会将信息推送给该企业号全部已关注成员,测试时需谨记

第二种内容

alert:
- "elastalert_modules.wechat_qiye_alert.WeChatAlerter"

alert_text_args:
  - name
  - num_hits
  - message

corp_id: "wwf66d9b7ea0f9bdc6"
secret: "1STRPTXAp5VMkKETTECokf_4E1ZqbiFhWotoIJfjZUU"
agent_id: 1000002
party_id: "1"
user_id: "@all"
tag_id: ""
原文地址:https://www.cnblogs.com/sanduzxcvbnm/p/13674238.html