Praeco is an alerting tool for Elasticsearch โ a GUI for ElastAlert 2, using the ElastAlert API.
๐ Praeco is a completely free GPLv3 project, in return I only ask that you fill out this simple survey about how you use it.
Run the app using Docker compose. Praeco includes everything you need to get started. Just provide it the IP address of your Elasticsearch instance.
mkdir -p rules rule_templates
chmod -R 777 rules rule_templates
echo "slack_webhook_url: ''" | sudo tee -a rules/BaseRule.config >/dev/null
export PRAECO_ELASTICSEARCH=<your elasticsearch ip>
docker-compose up
Don't use 127.0.0.1 for PRAECO_ELASTICSEARCH. See first item under the Troubleshooting section.
To set up notification settings like API keys edit rules/BaseRule.config
.
Praeco should now be available on http://127.0.0.1:8080
A walkthrough article is available to guide you through creating your first rule.
If you use docker-compose.yml published on github as it is, it will be the current latest version instead of a specific version. If you want to specify a specific version, edit it yourself and then run docker-compose up --force-recreate --build
.
docker-compose down
docker rmi praecoapp/praeco:latest
docker rmi praecoapp/elastalert-server:latest
docker pull praecoapp/praeco:latest
docker pull praecoapp/elastalert-server:latest
docker-compose up --force-recreate --build
You may need to update your config files when a new version comes out. Please see UPGRADING.md for version-specific instructions.
Edit rules/BaseRule.config
, config/api.config.json
, config/elastalert.yaml
, and/or public/praeco.config.json
for advanced configuration options. See the api docs and the example ElastAlert 2 config for more information.
Any ElastAlert 2 option you put into rules/BaseRule.config
will be applied to every rule.
The following config settings are available in praeco.config.json:
// Link back to your Praeco instance, used in Slack alerts
"appUrl": "http://praeco-app-url:8080",
// A recordatus (https://github.com/johnsusek/recordatus) instance for javascript error reporting
"errorLoggerUrl": "",
// Hide these fields when editing rules, if they are already filled in template
"hidePreconfiguredFields": []
Praeco & elastalert server docker image relations table
praecoapp/elastalert-server ChangeLog
docker compose sample(telegram)
๐ ElastAlert 2 Alerts support status
First of all, please understand that it is open source software. If you need generous support, please consider paid support software.
Do not use bitsensor/elastalert
as it does not implement the features required by praeco. Use praecoapp/elastalert-server
.
Do not use karql/elastalert2-server
as it does not implement the features required by praeco. Use praecoapp/elastalert-server
.
yelp/elastalert is no longer supported as maintenance has been discontinued.
Main challenges of yelp/elastalert
Not Support
Elasticserch 6 is no longer supported from elastalert2 2.4.0.
Please use praecoapp/elastalert-server:20220109
with elastalert2 installed before 2.4.0.
Support
Not Support
Not Support
Not Support
Not Support
Not Support
Not Support
Not Support
Not Support
Not Support
Not Support
Not Support
Not Support
Currently, an error will occur when BaseRule.config is empty, so please make it as described below.
echo "slack_webhook_url: ''" | sudo tee -a rules/BaseRule.config >/dev/null
There are no plans to support this at this time.
There are no plans to support this at this time.
It is possible to set within or outside the time zone specified in the Use Time Window.
It can be set with Limit Excecution.
ElastAlert Server Helm Chart
Praeco Helm Chart
Installing Praeco (ElastAlert GUI) into Kubernetes with Helm
Edit config/elastalert.yaml
and uncomment the appropriate lines.
Edit config/api.config.json
and set/add "es_ssl": true
.
option "ea_verify_certs"
, "es_ca_certs"
, "es_client_cert"
, "es_client_key"
.
configuration
Edit es_username
and es_password
in config/api.config.json
and config/elastalert.yaml
.
The praeco UI is served by an included nginx server (see Dockerfile). Configure it as you would any nginx project by editing the files in nginx_config
. Then update your docker-compose.yml and add your certificate files (under webapp volumes). Another option is using a reverse proxy.
http://www.my-domain.com:8080/my-path/
Uncomment the declaration of the VUE_APP_BASE_URL
environment variable in docker-compose.yml
and define the path you want.
environment:
VUE_APP_BASE_URL: /my-path/
Uncomment the rewrite command in nginx.config/default.conf
and define the same path as in teh environment variable above.
rewrite ^/my-path(/.*)$ $1 last;
Edit config/elastalert.yaml
and config/api.config.json
and change the writeback_index values.
First, install docker and docker-compose.
Then, using powershell, run these commands:
$Env:PRAECO_ELASTICSEARCH="1.2.3.4"
docker-compose.exe up
Replace 1.2.3.4 with your Elasticsearch IP.
Unfortunately this is not a possibility for two reasons. First, praeco only supports a subset of ElastAlert 2 features, so only certain rules would work. Second, praeco cannot automatically create the query builder ui from an arbitrary ElastAlert 2 filter
entry, due to the potential complexity and combinations of filters someone can put in their rule file.
Yes, the praeco rule files are 100% compatible with other elastalert servers.
Praeco, running within a docker container, cannot communicate with your ES bound to localhost. You need to change your ES network.host
setting
to something different. The value of _site_
is suggested, that will bind to a local network IP on your machine. Then use that
IP address for PRAECO_ELASTICSEARCH. Here's a working example:
elasticsearch -E network.host=_site_
export PRAECO_ELASTICSEARCH=192.168.1.145
mkdir -p rules rule_templates
chmod -R 777 rules rule_templates
docker-compose up
Replace 192.168.1.145 with the IP address your ES binds to (look for bound_addresses in the elasticsearch launch log).
When editing a rule, click "WITH OPTIONS" and try using the "Use count query" option. This can dramatically speed up processing time for large amounts of data (tens of thousands of results).
First of all, try to test your alert with varying time frames and see if that is returning any results.
If the test is returning results, but you are not receiving any alerts, check the error log. There may be a problem with your alerter settings. Make sure you edited rules/BaseRule.config and have correct values in there.
If the test is not returning results, even though you think it should, try reading the ElastAlert 2 docs for your rule type. Compare the yaml from praeco with the options from the docs to make sure the rule is being created as expected. If praeco is generating the wrong yaml, please file an issue.
You will see this error when launching if praeco cannot find elasticsearch at the IP address you specified at \$PRAECO_ELASTICSEARCH. Please make sure you can communicate with this IP address by issuing the following command: curl http://$PRAECO_ELASTICSEARCH:9200
. If the connection is refused, your machine cannot communicate with Elasticsearch, it may be a networking problem.
Make sure the channel/username you are trying to post to exists.
Please see https://elastalert2.readthedocs.io/en/latest/ruletypes.html#thehive for how to configure your BaseRule.config file.
hive_connection
is set in BaseRule.config. hive_connection:
hive_host: http://localhost
hive_port: <hive_port>
hive_apikey: <hive_apikey>
hive_proxies:
http: ''
https: ''
hive_alert_config
is set on the Praeco screen.hive_observable_data_mapping
.Please see https://elastalert2.readthedocs.io/en/latest/ruletypes.html#slack for how to configure your BaseRule.config file.
slack_webhook_url: 'https://hooks.slack.com/services/xxxxxxxxx/xxxxxxxx/xxxxxxxxxxxxxxxxxxx'
telegram_room_id can be set on the praeco screen.
Please see https://elastalert2.readthedocs.io/en/latest/ruletypes.html#telegram for how to configure your BaseRule.config file.
telegram_bot_token: 'xxxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
Please see https://elastalert2.readthedocs.io/en/latest/ruletypes.html#mattermost for how to configure your BaseRule.config
file.
mattermost_webhook_url: 'https://xxxxxx/hooks/xxxxxxxxxxxxxxxx'
Please see https://elastalert2.readthedocs.io/en/latest/ruletypes.html#rocket-chat for how to configure your BaseRule.config
file.
rocket_chat_webhook_url: 'https://xxxxxx/xxxxx/xxxxxxxxxxxxxxxx'
Sorry Not Support email_format.
Please see https://elastalert2.readthedocs.io/en/latest/ruletypes.html#email for how to configure your BaseRule.config
file.
Describe the following settings in BaseRule.config. Please set other settings on the screen.
smtp_auth_file: '/opt/elastalert/pass/smtp_auth_user.yaml'
smtp_auth_user.yaml
user: xxx@yahoo.co.jp
password: xxx
Google account in advance โ Apps that can access your account โ Allow less secure apps: Disabled โ Enabled When I specified the Gmail address with from_addr and checked the operation, it worked without problems.
smtp_auth_file: '/opt/elastalert/smtp/smtp_auth_user.yaml"
smtp_auth_user.yaml
user: xxx@gmail
password: xxx
Please see https://elastalert2.readthedocs.io/en/latest/ruletypes.html#jira for how to configure your BaseRule.config
file.
Praeco is a vue.js app (hosted in an nginx docker container) that communicates with the ElastAlert API (running in another docker container) to view/edit rules. The elastalert api interacts with the included ElastAlert 2 python daemon directly for various tasks including testing and silencing rules, and indirectly by modifying or creating rule files in the rules/ directory.
When you run praeco using the quickstart instructions, it runs these two docker containers, per the docker-compose.yml file.
Praeco uses a fork of the elastalert api server, which is why the docker image source is johnsusek/elastalert-server.
NOTE: Only the api server is a fork, the ElastAlert 2 daemon itself is built from the master
branch whenever a new version of the johnsusek/elastalert-server
docker image is created.
Please see the development section below if you're interested in running these services separately.
NOTE: If you're just interested in developing Praeco UI features locally (and not changing ElastAlert 2 or the api), you can skip right to Praeco setup and just run the internal ElastAlert Server with docker-compose up elastalert-server
.
First, you need a local copy of the elastalert api server running, which itself needs ElastAlert 2. Start by cloning the neccessary repos
$ cd
$ git clone https://github.com/jertel/elastalert2.git
$ git clone https://github.com/johnsusek/elastalert-server.git
$ git clone https://github.com/johnsusek/praeco.git
Python Support version
Elasticsearch Support version
Configure the ElastAlert 2 config.yaml
with:
es_host
writeback_index
rules
cd ~/elastalert2
mkdir -p rules rule_templates
chmod -R 777 rules rule_templates
echo "slack_webhook_url: ''" | sudo tee -a rules/BaseRule.config >/dev/null
pip install "setuptools>=11.3"
python setup.py install
cp ./examples/config.yaml.example ./config.yaml
vi config.yaml
Configure the api server config.json
with:
elastalertPath
es_host
writeback_index
from the config.yaml# nvm install
# https://github.com/nvm-sh/nvm#install--update-script
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
$ vi ~/.bash_profile
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
source ~/.bash_profile
# npm & node install
npm install -g npm
nvm install 18.19.0
cd ~/elastalert-server
vi config/config.json
nvm use "$(cat .nvmrc)"
npm install
npm run start
You should see this line if it started successfully:
INFO elastalert-server: Server: Server started
Finally, run praeco:
# No need to implement if the environment is the same as elastalert-server
# nvm install
# https://github.com/nvm-sh/nvm#install--update-script
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
$ vi ~/.bash_profile
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
source ~/.bash_profile
# npm & node install
npm install -g npm
nvm install 18.19.0
cd ~/praeco
nvm use "$(cat .nvmrc)"
npm install --legacy-peer-deps
export PRAECO_ELASTICSEARCH=<your elasticsearch ip>
npm run serve
You should now see the UI running at http://localhost:8080.
If you have any difficulties please open a github issue with your problem.
John Susek |
Naoyuki Sano |