update elastalert

This commit is contained in:
kev 2019-10-30 18:57:53 +08:00
parent 3e1c0d9d79
commit cb3370fc15
4 changed files with 20 additions and 12 deletions

View File

@ -77,6 +77,7 @@ A collection of delicious docker recipes.
- [x] cadvisor
- [x] casperjs :+1:
- [x] collectd
- [x] elastalert
- [x] freegeoip
- [x] freeradius
- [x] frp :cn:
@ -269,7 +270,6 @@ A collection of delicious docker recipes.
- [x] cachethq/docker
- [x] drone/drone
- [x] drupal
- [x] elastalert
- [x] elk
- [x] flogo/flogo-docker
- [x] mher/flower

View File

@ -6,19 +6,25 @@ FROM python:3.6-alpine
ENV ELASTALERT_VERSION=v0.2.1
ENV ELASTALERT_HOME=/opt/elastalert
ENV TZ=UTC
WORKDIR ${ELASTALERT_HOME}
RUN set -xe \
&& apk add --no-cache \
bash \
curl \
libffi \
libmagic \
libssl1.1 \
musl \
tzdata \
&& apk add --no-cache -t .build-deps \
build-base \
curl \
libffi-dev \
libmagic \
musl-dev \
openssl-dev \
python-dev \
tzdata \
python3-dev \
&& pip install elastalert==${ELASTALERT_VERSION} \
&& mkdir -p rules \
&& curl -sSL https://github.com/Yelp/elastalert/raw/${ELASTALERT_VERSION}/config.yaml.example > config.yaml \

View File

@ -7,11 +7,11 @@ patterns of interest from data in Elasticsearch.
## up and running
```bash
$ docker-compose up -d
$ docker-compose exec elastalert sh
>>> cd /opt/elastalert/rules
>>> elastalert-test-rule example.yaml
$ 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
```
> ElastAlert will also load new rules, stop running missing rules, and restart

View File

@ -7,8 +7,12 @@ type: frequency
index: logstash-*
doc_type: _doc
num_events: 10
use_count_query: true
timeframe:
hours: 1
@ -20,6 +24,4 @@ filter:
alert:
- command
command:
- echo
- "{match[@timestamp]} {match[message]}"
command: [echo, bad, things, happen]