前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >ElastAlert 基于Elasticsearch的监控告警

ElastAlert 基于Elasticsearch的监控告警

作者头像
Java后端技术
发布2018-08-09 11:01:34
1.3K0
发布2018-08-09 11:01:34
举报
文章被收录于专栏:Java后端技术栈Java后端技术栈

Elastalert是Yelp公司用python2写的一个报警框架(目前支持python2.6和2.7,不支持3.x).

GitHub地址为 https://github.com/Yelp/elastalert

一、环境

Ubuntu 16.10(内核 4.8.0-37-generic) elasticsearch 5.2.0 logstash 5.2.0 kibana 5.2.0

二、依赖

参见:

http://elastalert.readthedocs.io/en/latest/running_elastalert.html#requirements

  • Elasticsearch
  • ISO8601 or Unix timestamped data
  • Python 2.6 or 2.7
  • pip, see requirements.txt

三、安装Elastalert

安装之前先运行 python --version查看python的版本:

下载最新elastalert并安装模块:

安装完后,会在 /usr/local/bin/ 下生成4个elastalert命令:

四、设置elasticsearch索引

参见 setting-up-elasticsearch

https://elastalert.readthedocs.io/en/latest/running_elastalert.html#setting-up-elasticsearch

elastalert-create-index 这个命令会在elasticsearch创建索引,这不是必须的步骤,但是强烈建议创建。因为对于,审计,测试很有用,并且重启elastalert不影响计数和发送alert,默认情况下,创建的索引叫 elastalert_status

具体生成的数据,请参见 ElastAlert Metadata Index:

https://elastalert.readthedocs.io/en/latest/elastalert_status.html#metadata

五、设置配置文件和规则Rule

参见 creating-a-rule:

https://elastalert.readthedocs.io/en/latest/running_elastalert.html#creating-a-rule

六、测试规则

参见 Testing Your Rule

具体配置,参见 commonconfig

七、运行

# 返回 {"_index":"logstash-2017.02.14","_type":"test","_id":"AVo6oVCnFreCcJPhQqgX","_version":1,"result":"created","shards":{"total":2,"successful":1,"failed":0},"created":true}

@timestamp的时间是UTC时间,换算方式北京时间(东八区)减8小时,例如2017-02-14 11:21:50的UTC时间是 2017-02-14 03:21:50

八、Alert


原文作者:赵安家

原文链接:https://anjia.ml/2017/02/14/elasticsearch-elastalert/

版权声明

Java后端技术所推送文章,为本人原创、网上收集或其他作者投稿,对于网上收集部分除非确实无法确认,我们都会注明作者和来源。部分文章推送时未能与原作者取得联系。若涉及版权问题,烦请原作者联系我们,我们会在24小时内删除处理,谢谢!^_^ QQ:1573876303。

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2017-03-06,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 Java后端技术 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 二、依赖
  • 三、安装Elastalert
  • 安装之前先运行 python --version查看python的版本:
  • 四、设置elasticsearch索引
  • 八、Alert
相关产品与服务
Elasticsearch Service
腾讯云 Elasticsearch Service(ES)是云端全托管海量数据检索分析服务,拥有高性能自研内核,集成X-Pack。ES 支持通过自治索引、存算分离、集群巡检等特性轻松管理集群,也支持免运维、自动弹性、按需使用的 Serverless 模式。使用 ES 您可以高效构建信息检索、日志分析、运维监控等服务,它独特的向量检索还可助您构建基于语义、图像的AI深度应用。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档