1. 启动容器
docker run -itd --restart=always --name elastalert2 \
-v /opt/elk/elastalert2/data:/opt/elastalert/data \
-v /opt/elk/elastalert2/config.yaml:/opt/elastalert/config.yaml \
-v /opt/elk/elastalert2/rules:/opt/elastalert/rules \
-v /opt/elk/elastalert2/elastalert_modules:/opt/elastalert/elastalert_modules \
-e ELASTICSEARCH_HOST="192.168.169.130" \
-e ELASTICSEARCH_PORT=9200 \
-e CONTAINER_TIMEZONE="Asia/Shanghai" \
-e SET_CONTAINER_TIMEZONE=True \
-e TZ="Asia/Shanghai" \
-e SET_CONTAINER_TIMEZONE=True \
-e ELASTALERT_BUFFER_TIME=10 \
-e ELASTALERT_RUN_EVERY=1 \
jertel/elastalert2
2. 进入容器启动elastalert2
python -m elastalert.elastalert --verbose --es_debug --config /opt/elastalert/config.yaml
3. 指定rule启动elastalert2
python -m elastalert.elastalert -