1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2025-02-03 13:21:49 +02:00

update elastalert

This commit is contained in:
kev 2019-10-30 20:04:37 +08:00
parent cb3370fc15
commit 9fc9538617
2 changed files with 13 additions and 8 deletions

View File

@ -11,7 +11,13 @@ $ docker-compose run --rm elastalert sh
>>> elastalert-create-index --config config.yaml
>>> elastalert-test-rule --config config.yaml rules/example.yaml
>>> exit
$ docker-compose up -d
$ docker-compose logs -tf
elastalert_1 | 2019-10-30T10:33:31.960452334Z bad things happend
elastalert_1 | 2019-10-30T10:42:27.952772739Z bad things happend
elastalert_1 | 2019-10-30T10:50:22.808460534Z bad things happend
```
> ElastAlert will also load new rules, stop running missing rules, and restart

View File

@ -1,17 +1,11 @@
name: Example rule
name: example rule
es_host: elasticsearch
es_port: 9200
type: frequency
index: logstash-*
doc_type: _doc
num_events: 10
use_count_query: true
num_events: 10
timeframe:
hours: 1
@ -22,6 +16,11 @@ filter:
query: 'response:[500 TO *]'
alert:
- slack:
slack_webhook_url: https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXX
slack_username_override: ElastAlert
slack_channel_override: '#monit'
slack_emoji_override: ':bell:'
- command
command: [echo, bad, things, happen]