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

相关推荐
青山科技分享8 天前
跨境电商卖家如何用AI监控竞品价格和动态?
监控·卖家·盯着
鸿观工坊10 天前
Prometheus 监控报告编写:SLO报告
监控
vivo互联网技术11 天前
域名埋点零侵入实时校验实践:基于代理转发与规则驱动的工具设计
前端·测试·监控·代理·埋点
Sayai11 天前
Elasticsearch Rollup 汇算索引实战:监控指标多粒度预聚合查询,附 painless 时间窗取每日最新值
大数据·运维·elasticsearch·搜索引擎·性能优化·监控
数据库小学妹13 天前
数据库运维五级成熟度:监控、备份、高可用怎么串起来
运维·数据库·监控
fengkai454517 天前
十三、Zabbix 监控
运维·服务器·zabbix·监控·网络设备
鸿观工坊25 天前
Prometheus 内置指标:每次抓取自动生成了哪些数据
监控
cws2004011 个月前
监控摄像头选型指南
运维·网络·监控
鸿观工坊1 个月前
第13篇 监控安全与权限治理
监控