Praeco is an alerting tool for Elasticsearch – a GUI for ElastAlert 2, using the ElastAlert API.
- Interactively build alerts for your Elasticsearch data using a query builder
- Preview results in an interactive chart
- Test your alerts against historical data
- Send notifications to Slack, MS Teams, Email, Telegram, Jira, Line Notify, Mattermost, Command, Gitter, Amazon SNS, Amazon SES, Zabbix, Twilio, PagerTree, Exotel, GoogleChat, Stomp, Splunk On-Call (Formerly VictorOps), ServiceNow, Chatwork, Discord, TheHive, Alerta, Datadog, Rocket.Chat, PagerDuty, Tencent SMS, Dingtalk, Alertmanager, OpsGenie, Graylog GELF, Lark, IRIS or an HTTP POST/HTTP POST 2 endpoint
- Supports the Any, Blacklist, Whitelist, Change, Frequency, Flatline, Spike, Cardinality, New Term, and Metric Aggregation rule types
- View logs of when your alerts check, fire and fail
👉 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.
- We are not responsible for fixing bugs.
- There is no obligation to respond to your request.
- There is no obligation to add features.
- We do not always answer issues.
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
.
Does yelp/elastalert support it?
yelp/elastalert is no longer supported as maintenance has been discontinued.
Main challenges of yelp/elastalert
- Not compatible with python 3.12 or later.
- Line Notify, PagerTree, Stomp and Zabbix alert notifications do not work due to a bug.
- kibana Discover only guarantees operation up to kibana 7.3.
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
- Supports elasticsearch 8 with praeco 1.8.11 or later.
- elastalert-server is compatible with elasticsearch 8.
Not Support
Not Support
Not Support
Is it possible to set custom format (timestamp_type, timestamp_format, timestamp_format_expr) on the screen?
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.
I can't send an email when I specify a gmail or Microsoft 365 address in from_addr of Email. Is there a workaround?
- For Gmail, you need to set Allow insecure apps.
- There is no workaround for Microsoft 365.
It is possible to set within or outside the time zone specified in the Use Time Window.
It can be set with Limit Excecution.
When using the field specified by alert_subject_args in alert_subject, how do you set it on the screen?
- Click the Alert Subject Args link for the number of fields you want to add and press the "Add alert_textargs" button. Enter the field you want to add.
- When embedding a field in Subject, specify a serial number from 0, such as {0} for the first and {1} for the second.
- Click the AlertTextArgs link for as many fields as you want to add and press the "Add alert_textargs" button. Enter the field you want to add.
- When embedding a field in Body text, specify a serial number from 0, such as {0} for the first and {1} for the second.
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.
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.- Not Support
hive_observable_data_mapping
.
Please see https://elastalert2.readthedocs.io/en/latest/ruletypes.html#slack for how to configure your BaseRule.config file.
- Replace slack_webhook_url with the URL of your channel.
- Describe the following settings in BaseRule.config. Please set other settings on the screen.
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.
- Replace telegram_bot_token with the your bot token.
- Describe the following settings in BaseRule.config. Please set other settings on the screen.
telegram_bot_token: 'xxxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
Please see https://elastalert2.readthedocs.io/en/latest/ruletypes.html#mattermost for how to configure your BaseRule.config
file.
- Replace mattermost_webhook_url with the URL of your webhook.
- Describe the following settings in BaseRule.config. Please set other settings on the screen.
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.
- Replace rocket_chat_webhook_url with the URL of your webhook.
- Describe the following settings in BaseRule.config. Please set other settings on the screen.
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: [email protected]
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
- Compatible with 3.12 or later
Elasticsearch Support version
- 7.x
- 8.x
Configure the ElastAlert 2 config.yaml
with:
- Your
es_host
- A unique
writeback_index
- Change the rules_folder to
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:
- An absolute path to your ElastAlert 2 folder for
elastalertPath
- The address of your elasticsearch instance for
es_host
- The same
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 20.12.2
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 20.12.2
cd ~/praeco
nvm use "$(cat .nvmrc)"
npm install
export PRAECO_ELASTICSEARCH=<your elasticsearch ip>
# edit src/main.js
/api-ws/test to /ws/test
# edit vue.config.js
/api-ws/test to /ws/test
# run
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 |