首页 > 其他分享 >elk报警alert设置

elk报警alert设置

时间:2022-11-21 09:56:32浏览次数:29  
标签:elk Required 报警 alert source file test id

设置alert

 

 

 

 

# Alert when the rate of events exceeds a threshold

# (Optional)
# Elasticsearch host
es_host: elasticsearch.hostname1

# (Optional)
# Elasticsearch port
es_port: 9200


# (Required)
# Rule name, must be unique
name: test生产error_info异常报警

# (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: error_info*
timestamp_field: dateTime

# (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: 4
  minutes: 1
# (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_string:
    query: "NOT thrown.name:*RpcException AND NOT source.file : IMMessageServiceImpl.java AND NOT source.file : CrhClientUtil.java AND NOT source.file : DesThreadPool.java NOT source.file : DESV2Util.java"

realert:
  minutes: 3

#用户认证文件,需要user和password两个属性
#注意将${userName}替换成具体用户名
smtp_auth_file: /opt/elastalert/auth/test_smtp_auth_file.yaml

# (Required)
# The alert is use when a match is found
alert:
#- "email"
- "elastalert_modules.wechat_qiye_alert.WeChatAlerter"
#- "test"
# (required, email specific)
# a list of email addresses to send alerts to

alert_text: "
test{}异常报警 \n
主机hostIp: {}\n
服务路径: {}\n
索引名称: {}\n
发生时间: {}\n
traceId : {}\n
用户信息: {}\n
方法行数: {}.{}.{}\n
异常类型: {}\n
异常信息: {}\n
异常内容: {}
"

alert_text_type: alert_text_only
 
# 企业微信告警的数据不需要太多,太长
alert_text_args:
- customContextMap.projectName
- customContextMap.hostIp
- customContextMap.userDir
- _index
- dateTime
- contextMap.traceId
- contextMap.uid
- source.file
- source.method
- source.line
- thrown.name
- thrown.message
- message

#后台登陆后【设置】->【权限管理】->【普通管理组】->【创建并设置通讯录和应用权限】->【CorpID,Secret】
#设置微信企业号的appid
corp_id: ww11111222223433bc
#设置微信企业号的Secret
secret: lwQHPw_111111111111111111111111111111111111
#后台登陆后【应用中心】->【选择应用】->【应用id】
#设置微信企业号应用id
agent_id: 1000007
#部门id 2 - java group
party_id: 4
#用户微信号
user_id:
- 1111111

# 标签id
#tag_id: xx

# The hostname of the test server.
test_server: "test.111111111111.cn"
# The project to open the ticket under.
test_project: "JAVA_ALERT"
#  The type of issue that the ticket will be filed as. Note that this is case sensitive.
test_issuetype: "alert"
# The path to the file which contains test account credentials.
#test_account_file: "/root/elastalert/java_rules/test_acct.txt"

 

标签:elk,Required,报警,alert,source,file,test,id
From: https://www.cnblogs.com/bestzhang/p/16910409.html

相关文章

  • elk搭建
    elk搭建参考资料:https://www.cnblogs.com/adawoo/p/11665532.htmljdk安装https://www.cnblogs.com/cheesebar/p/9126171.htmlelk安装1.关闭防火墙和selinuxsy......
  • 通过 API 快速创建 AlertManager silence
    概述通常我们要silence某个AlertManager的alert时,需要通过UI界面操作,如下图:效率有点低,而且不够自动化,那么是否可以有一种办法快速创建AlertManagersilence呢?......
  • 通过 API 快速创建 AlertManager silence
    概述通常我们要silence某个AlertManager的alert时,需要通过UI界面操作,如下图:效率有点低,而且不够自动化,那么是否可以有一种办法快速创建AlertManagersilence呢......
  • layer和sweetalert2消息提醒js插件简单使用
    <!DOCTYPEhtml><htmllang="en"backgound=""><head><metacharset="UTF-8"/><metahttp-equiv="X-UA-Compatible"content="IE=edge"/><metaname......
  • ELK8.5的搭建
    nodejs安装包http://nodejs.cn/download/可视化管理工具---Elasticsearch-headhttps://github.com/mobz/elasticsearch-head/archive/refs/tags/v5.0.0.tar.gzElast......
  • 【检查ORACLE阻塞】如果阻塞超过N秒则发短信报警并KILL进程
    检查oracle阻塞,如果阻塞超过N秒则发短信报警阻塞超过分钟后自动kill进程检查oracle分布式事务预留锁,回滚事务/***注意:链接服务器clinicdb要设置RPC和RPCOut为true,否则......
  • 线上服务器巨卡,网络慢,客户报警
     #nethogseth0发现占流量的进程 arthas使用thread观察对应的Java线程     开发侧七牛云代码上传错误造成了死循环,导致不断发送数据到七牛云 ......
  • 使用ShakeAlert检测流量波动(上篇)
    Edgio最新推出的ShakeAlert提高了网络事件的可视性在运行大型全球分布式网络时,硬件故障、供应商脱节和其他行为变故是经常发生的。因此,能够在第一次出现故障迹象时示警的......
  • 使用ShakeAlert检测流量波动(下篇)
    Shake警报系统ShakeAlert监听来自21个路线收集器的实时信息反馈,这些收集器是RIPENCC的路线信息系统(RIS)Project2的一部分。当数据从这些采集器到达时,它被分组为一分钟的......
  • 【ELK解决方案】ELK集群+RabbitMQ部署方案以及快速开发RabbitMQ生产者与消费者基础服
    前言:大概一年多前写过一个部署ELK系列的博客文章,前不久刚好在部署一个ELK的解决方案,我顺便就把一些基础的部分拎出来,再整合成一期文章。大概内容包括:搭建ELK集群,以及写一......