All Projects → manankalra → elastalert-tutorial

manankalra / elastalert-tutorial

Licence: MIT license
Get started with Elastalert from Yelp

Projects that are alternatives of or similar to elastalert-tutorial

Sentinl
Kibana Alert & Report App for Elasticsearch
Stars: ✭ 1,233 (+4466.67%)
Mutual labels:  alerting, elk, elastic
Siem From Scratch
SIEM-From-Scratch is a drop-in ELK based SIEM component for your Vagrant infosec lab
Stars: ✭ 31 (+14.81%)
Mutual labels:  elk, elastic
Elasticambari
Elastic Service for Ambari
Stars: ✭ 108 (+300%)
Mutual labels:  elk, elastic
Helk
The Hunting ELK
Stars: ✭ 3,097 (+11370.37%)
Mutual labels:  elk, elastic
Elastic
Elastic Stack (6.2.4) 을 활용한 Dashboard 만들기 Project
Stars: ✭ 121 (+348.15%)
Mutual labels:  elk, elastic
docker-elk-example
No description or website provided.
Stars: ✭ 58 (+114.81%)
Mutual labels:  elk, x-pack
ELK-Hunting
Threat Hunting with ELK Workshop (InfoSecWorld 2017)
Stars: ✭ 58 (+114.81%)
Mutual labels:  elk, elastic
ansible-role-kibana
Ansible Role - Kibana
Stars: ✭ 104 (+285.19%)
Mutual labels:  elk
elasticsearch plugin
Nodeos plugin for archiving blockchain data into Elasticsearch.
Stars: ✭ 57 (+111.11%)
Mutual labels:  elastic
kthxbye
Prometheus Alertmanager alert acknowledgement management daemon
Stars: ✭ 128 (+374.07%)
Mutual labels:  alerting
Geolocator-2
Learn how to find and work with locations in Django, the Yelp API, and Google Maps api.
Stars: ✭ 24 (-11.11%)
Mutual labels:  yelp
Guesstimator
🍻Uses Google, Yelp, and Foursquare APIs to retrieve and rank bars
Stars: ✭ 84 (+211.11%)
Mutual labels:  yelp
ansible-role-elasticsearch-curator
Ansible Role - Elasticsearch Curator
Stars: ✭ 31 (+14.81%)
Mutual labels:  elk
robusta
Open source Kubernetes monitoring, troubleshooting, and automation platform
Stars: ✭ 772 (+2759.26%)
Mutual labels:  alerting
random-restaurant-generator
An Android app that queries Yelp's API for a random restaurant near you
Stars: ✭ 15 (-44.44%)
Mutual labels:  yelp
data-processing-with-logstash
Contains the configuration files used within the Data Processing with Logstash course.
Stars: ✭ 76 (+181.48%)
Mutual labels:  elk
PlanSum
[AAAI2021] Unsupervised Opinion Summarization with Content Planning
Stars: ✭ 25 (-7.41%)
Mutual labels:  yelp
WaveProp in MATLAB
Single-file implementations of 2D and 3D acoustic and elastic wave propagation in time domain using finite-differences(FDTD). Simple formulation and implementation
Stars: ✭ 39 (+44.44%)
Mutual labels:  elastic
MyDocs
文档类项目,目前自己技术研究日常所需的文档,自己写的文档汇总
Stars: ✭ 76 (+181.48%)
Mutual labels:  elk
elastic-apm-laravel
Laravel APM agent for Elastic v2 intake API
Stars: ✭ 64 (+137.04%)
Mutual labels:  elastic

Alerting with Elastalert


This will get you started with Alerting using Yelp's alternative to the alerting feature of X-Pack from Elastic.

Repository structure

  • configurations

    • config.yaml - configurations file for elastalert
    • smtp_auth_file.yaml - authentication file for alerting via email
    • zdaemon.conf - configuration file for runneing elastalert as a daemon using zdaemon
  • rules - contains sample configurations rules to alert on CPU, memory and disk usage

  • requirements.txt - required python dependencies


1. Requirements


  • Elasticsearch

  • ISO8601 or Unix timestamped data

  • Python 2.7


2. Installation


If you're using Anaconda, do the following:

  • Create a new conda environment: conda create --name <name> python=2.7 -y.

  • Switch to the created environment: source activate <name>.

  • Install pip in the same environment: conda install pip. This is needed because most of the Elasalert package dependencies are not present in the Continuum channels.

Refer https://goo.gl/7QUSo2 for details on sharing a Conda environment. <br/ >

Installing Elastalert

  • Execute pip install -r requirements.txt to install the dependencies.

  • Finally, run pip install elastalert.


3. Getting started


  • Create an index for ElastAlert to write to by running elastalert-create-index and follow the input prompts.

  • Clone the Elastalert repo: git clone https://github.com/yelp/elastalert.

  • Navigate to the cloned repo and create config.yaml file with these settings:

rules_folder: alert_rules
run_every:
  seconds: 10
buffer_time:
  seconds: 10
#es_username: <username>
#es_password: <password>
es_host: localhost
es_port: 9200
alert_time_limit:
  days: 1
  • Create a directory called alert_rules. Navigate to it and create your yaml rule files in the same folder.

4. Running Elastalert


Testing a rule

  • elastalert-test-rule alert_rules/<your_rule_name>.yaml.

Running a single rule

  • python -m elastalert.elastalert --verbose --rule <your_rule_name>.yaml.

Running multiple rules

  • python -m elastalert.elastalert --verbose --config config.yaml

This will load all the rules present in the alert_rules directory.

5. Running Elastalert as a daemon


  • Install zdaemon: pip install zdaemon. (https://goo.gl/FCww8S)

  • Create a zdaemon.conf file with these contents:

<runner>
  program python -m elastalert.elastalert --conf config.yaml
  socket-name /tmp/elastalert.zdsock
  forever true
</runner>
  • To start Elastalert, execute: zdaemon -C zdaemon.conf start.

  • To stop Elastalert, execute: zdaemon -C zdaemon.conf stop.


6. Additional configurations


  • Alerting via Email

    • In the yaml file of the specific rule, append the following:
      alert:
      - email
      email: 
      	- "<email-to-which-the-alert-will-be-sent>"
      smtp_host: "smtp.gmail.com" #for google email addresses
      smtp_port: 465 #for google email addresses
      smtp_ssl: true
      from_addr: "<email-from-which-the-alert-will-be-sent>"
      smtp_auth_file: "<name-of-the-authentication-file>.yaml"
    • Contents of the smtp_auth_file.yaml include user and password fields:
      user: "<email-address>"
      password: "<password>"

  • Alerting via Slack

    • In the yaml file of the specific rule, append the following:
      alert:
       - slack
      slack_webhook_url: "<webhook-url-of-the-slack-channel>"
      slack_channel_override: "#<channel-name>"
      slack_username_override: "@<user-name>"

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].