ElasticAlert2-ELK告警+webhook配置

ELK告警+webhook配置

shell 复制代码
mkdir /opt/elasticalert2/rules -p
cd /opt/elasticalert2
vim elastalert.yaml
shell 复制代码
rules_folder: /opt/elastalert/rules

run_every:
  seconds: 10

buffer_time:
  minutes: 15

es_host: 10.2.209.146
es_port: 9200
es_username: elastic
es_password: password


writeback_index: elastalert_status

alert_time_limit:
  days: 2

配置规则

plain 复制代码
cd /opt/elasticalert2/rules
vim  bi_error_log_alert.yaml
shell 复制代码
name: "a" 
type: "frequency"
index: "app_service-*"  ##要监控的索引模式
is_enabled: true
num_events: 2
timeframe:
  minutes: 1
filter:
  - query:
      query_string:
        query: "message: \"ERROR\" and \"Exception\""  ##筛选到异常时候
## webhook告警
alert: post2
http_post2_url: "http://10.2.203.133:9669/omp/esAlert/receive"
http_post2_payload:
  content: "{{message}}"   ##把符合筛选的日志不修改直接转发

部署

shell 复制代码
docker run -d --name elastalert2 --restart=always \
-v /opt/elasticalert2/elastalert.yaml:/opt/elastalert/config.yaml \
-v /opt/elasticalert2/rules:/opt/elastalert/rules \
ghcr.io/jertel/elastalert2/elastalert2 --verbose

参考资料:

Getting Started --- ElastAlert 2 0.0.1 documentation

ELK告警设置-Elastaler2 - 自行车骑手 - 博客园

相关推荐
行百里er1 天前
加个依赖就生效?一行搞定 Spring Boot Starter 自动装配
java·后端·监控
七夜zippoe4 天前
DolphinDB 2.x 集群监控运维平台实战:从指标采集到告警自愈
运维·集群·监控·告警·dolphindb·指标采集
七夜zippoe4 天前
基于 DolphinDB 2.x 的系统性能调优实战:从监控、分析到优化验证的全链路指南
性能调优·监控·分析·dolphindb·优化验证
不积跬步无以至千里4 天前
服务器端性能测试判断磁盘瓶颈的方法
磁盘·监控·性能·分析·lsblk·iostat·瓶颈
lisanmengmeng7 天前
搭建elk环境并接入frostmourne,实现监控报警效果(e二)
elk·监控·日志·日志监控
26519405112648012 天前
08-告警并发与多Master同步
go·监控
lisanmengmeng12 天前
飞书 API使用
飞书·监控·日志·日志监控·监控及日志
三维地图技术社区12 天前
24小时降雨316.1毫米:城市内涝是怎么发生的?排水防涝体系与应急管理一次讲透
监控·图新说·城市内涝·排水防涝·应急管理·三维地下管网·应急预案三维可视化
26519405112648013 天前
07-告警引擎与状态机
go·监控