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 - 自行车骑手 - 博客园

相关推荐
SkyWalking中文站5 小时前
认识 Horizon UI · 5/17:3D 基础设施地图
运维·监控·自动化运维
SkyWalking中文站1 天前
认识 Horizon UI · 1/17:SkyWalking 新一代可观测性控制台
运维·前端·监控
亲亲小宝宝鸭6 天前
前端性能监控:web-vitals
前端·性能优化·监控
kyriewen13 天前
前端错误监控最全指南:捕获 JS 异常、Promise 拒绝、资源加载失败,附上报代码
前端·javascript·监控
杨浦老苏14 天前
轻量级Docker仪表板Servedash
运维·docker·监控·群晖·仪表板
两行法桐16 天前
Docker安装ELK+Kafka
监控
杨浦老苏18 天前
家庭实验室监控仪表盘HomeLab-Monitor
运维·docker·监控·群晖
Luchang-Li18 天前
GPU传输带宽等信息监控nvidia-smi
人工智能·gpu·监控·性能·带宽
OpsEye19 天前
日志、指标、链路追踪,谁更适合定位故障?
运维·监控·日志分析