All Projects → johnsusek → Praeco

johnsusek / Praeco

Licence: gpl-3.0
Elasticsearch alerting made simple.

Projects that are alternatives of or similar to Praeco

Dockerfile
some personally made dockerfile
Stars: ✭ 2,021 (+490.94%)
Mutual labels:  logstash, elasticsearch
Elastiflow
Network flow analytics (Netflow, sFlow and IPFIX) with the Elastic Stack
Stars: ✭ 2,322 (+578.95%)
Mutual labels:  logstash, elasticsearch
Synesis lite suricata
Suricata IDS/IPS log analytics using the Elastic Stack.
Stars: ✭ 167 (-51.17%)
Mutual labels:  logstash, elasticsearch
Json Logging Python
Python logging library to emit JSON log that can be easily indexed and searchable by logging infrastructure such as ELK, EFK, AWS Cloudwatch, GCP Stackdriver
Stars: ✭ 143 (-58.19%)
Mutual labels:  logstash, elasticsearch
Ansible Elk
📊 Ansible playbook for setting up an ELK/EFK stack and clients.
Stars: ✭ 284 (-16.96%)
Mutual labels:  logstash, elasticsearch
Elk Stack
ELK Stack ... based on Elastic Stack 5.x
Stars: ✭ 148 (-56.73%)
Mutual labels:  logstash, elasticsearch
Docker Elastic Stack
ELK Stack Dockerfile
Stars: ✭ 175 (-48.83%)
Mutual labels:  logstash, elasticsearch
Vagrant Elastic Stack
Giving the Elastic Stack a try in Vagrant
Stars: ✭ 131 (-61.7%)
Mutual labels:  logstash, elasticsearch
Helk
The Hunting ELK
Stars: ✭ 3,097 (+805.56%)
Mutual labels:  logstash, elasticsearch
Dsiem
Security event correlation engine for ELK stack
Stars: ✭ 255 (-25.44%)
Mutual labels:  logstash, elasticsearch
Elk Hole
elasticsearch, logstash and kibana configuration for pi-hole visualiziation
Stars: ✭ 136 (-60.23%)
Mutual labels:  logstash, elasticsearch
Elasticsearch loader
A tool for batch loading data files (json, parquet, csv, tsv) into ElasticSearch
Stars: ✭ 300 (-12.28%)
Mutual labels:  logstash, elasticsearch
Elastic Stack
Aprenda Elasticsearch, Logstash, Kibana e Beats do jeito mais fácil ⭐️
Stars: ✭ 135 (-60.53%)
Mutual labels:  logstash, elasticsearch
Elk Docker
Elasticsearch, Logstash, Kibana (ELK) Docker image
Stars: ✭ 1,973 (+476.9%)
Mutual labels:  logstash, elasticsearch
Docker Elk
The Elastic stack (ELK) powered by Docker and Compose.
Stars: ✭ 12,327 (+3504.39%)
Mutual labels:  logstash, elasticsearch
Microservices Sample
Sample project to create an application using microservices architecture
Stars: ✭ 167 (-51.17%)
Mutual labels:  logstash, elasticsearch
Elassandra
Elassandra = Elasticsearch + Apache Cassandra
Stars: ✭ 1,610 (+370.76%)
Mutual labels:  logstash, elasticsearch
Elastic
Elastic Stack (6.2.4) 을 활용한 Dashboard 만들기 Project
Stars: ✭ 121 (-64.62%)
Mutual labels:  logstash, elasticsearch
Docker Elastic
Deploy Elastic stack in a Docker Swarm cluster. Ship application logs and metrics using beats & GELF plugin to Elasticsearch
Stars: ✭ 202 (-40.94%)
Mutual labels:  logstash, elasticsearch
Hastic Server
Hastic data management server for analyzing patterns and anomalies from Grafana
Stars: ✭ 292 (-14.62%)
Mutual labels:  elasticsearch, alerting

Praeco

GitHub release Docker Pulls GitHub stars

Praeco is an alerting tool for Elasticsearch – a GUI for ElastAlert, using the ElastAlert API is a fork.

  • 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, SNS, Zabbix, Twilio, PagerTree, Exotel, GoogleChat, Stomp, VictorOps, ServiceNow, Chatwork, Discord, TheHive, Alerta or an HTTP POST 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.

Quickstart

Run the app using Docker compose. Praeco includes everything you need to get started. Just provide it the IP address of your Elasticsearch instance.

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.

Upgrading

docker pull praecoapp/praeco
docker pull praecoapp/elastalert-server
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.

Configuration

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 config for more information.

Any Elastalert 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": []

FAQ

[Third Party Tools] ElastAlert Server & Praeco Helm Chart

ElastAlert Server Helm Chart
Praeco Helm Chart
Installing Praeco (ElastAlert GUI) into Kubernetes with Helm

How do I connect to elasticsearch using SSL?

Edit config/api.config.json and set/add "es_ssl": true.
option "es_ca_certs", "es_client_cert", "es_client_key".
configuration

How do I connect to elasticsearch with a username and password?

Edit es_username and es_password in config/api.config.json and config/elastalert.yaml.

How do I serve the praeco UI over https?

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.

How do I serve the praeco UI under a custom base path, i.e. 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;

How do I change the writeback index?

Edit config/elastalert.yaml and config/api.config.json and change the writeback_index values.

How do I change elastalert options, like SSL, user/pass, etc?

Edit config/elastalert.yaml and uncomment the appropriate lines.

How do I run this on Windows?

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.

Can I import my current elastalert rules into praeco?

Unfortunately this is not a possibility for two reasons. First, praeco only supports a subset of elastalert features, so only certain rules would work. Second, praeco cannot automatically create the query builder ui from an arbitrary elastalert filter entry, due to the potential complexity and combinations of filters someone can put in their rule file.

Can I export my praeco rules into another elastalert instance?

Yes, the praeco rule files are 100% compatible with other elastalert servers.

Troubleshooting

I am using 127.0.0.1 for PRAECO_ELASTICSEARCH and it isn't working

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).

I am getting high CPU usage on some of my rules

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).

I'm not receiving alerts even though I expect them

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 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.

Failed to establish a new connection: [Errno 111] Connection refused

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.

404 error in error log for slack webhook

Make sure the channel/username you are trying to post to exists.

How to setup Slack?

Please see https://elastalert.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.

slack_webhook_url: 'https://hooks.slack.com/services/xxxxxxxxx/xxxxxxxx/xxxxxxxxxxxxxxxxxxx'
slack_emoji_override: '📯'

How to setup Telegram?

telegram_room_id can be set on the praeco screen.

Please see https://elastalert.readthedocs.io/en/latest/ruletypes.html#telegram for how to configure your BaseRule.config file.

Replace telegram_bot_token with the your bot token.

telegram_proxy, telegram_proxy_login and telegram_proxy_pass do not need to be written in BaseRule.config if they do not need to be set.

telegram_bot_token: 'xxxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
telegram_proxy: ''
telegram_proxy_login: ''
telegram_proxy_pass: ''

How to setup Gitter?

Please see https://elastalert.readthedocs.io/en/latest/ruletypes.html#gitter for how to configure your BaseRule.config file.

Replace gitter_webhook_url with the URL of your webhook.

gitter_webhook_url: 'https://webhooks.gitter.im/e/xxxxxxxxxxxxxxxx'

How to setup Mattermost?

Please see https://elastalert.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.

mattermost_webhook_url: 'https://xxxxxx/hooks/xxxxxxxxxxxxxxxx'

How to setup Zabbix?

Please see https://elastalert.readthedocs.io/en/latest/ruletypes.html#zabbix for how to configure your BaseRule.config file.

Replace zbx_sender_host and zbx_sender_port with your environment's host name and port.

zbx_sender_host: 'zabbix-server'
zbx_sender_port: 10051

How to setup Email?

Sorry Not Support email_format.

Please see https://elastalert.readthedocs.io/en/latest/ruletypes.html#email for how to configure your BaseRule.config file.

example setting

smtp_host: 'smtp.mail.yahoo.co.jp'
smtp_port: 465 
smtp_ssl: true
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_port: 587

smtp_host: "smtp.gmail.com" 
smtp_port: 587 
smtp_ssl: false
smtp_auth_file: '/opt/elastalert/smtp/smtp_auth_user.yaml"

smtp_auth_user.yaml

user: [email protected]
password: xxx

smtp_port: 465

smtp_host: "smtp.gmail.com" 
smtp_port: 465 
smtp_ssl: true
smtp_auth_file: '/opt/elastalert/smtp/smtp_auth_user.yaml"

smtp_auth_user.yaml

user: [email protected]
password: xxx

How to setup Jira?

Please see https://elastalert.readthedocs.io/en/latest/ruletypes.html#jira for how to configure your BaseRule.config file.

Architecture details

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 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.

NOTE: Only the api server is a fork, the elastalert 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.

Manual/Dev installation

NOTE: If you're just interested in developing Praeco UI features locally (and not changing elastalert 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. Start by cloning the neccessary repos

$ cd
$ git clone https://github.com/Yelp/elastalert.git
$ git clone https://github.com/johnsusek/elastalert-server.git
$ git clone https://github.com/johnsusek/praeco.git

Setting up elastalert

with hundreds of open PRs and over 1000 open issues.

Doesn't work due to a bug

  • Line Notify
  • Zabbix
  • PagerTree
  • Stomp
  • SNS

Not Support

  • Chatwork
  • Discord

Main bugs

  • SNS(Duplicate setting name. Profile implementation bug, etc)
  • Email(smtp_host is not work smtp.gmail.com and smtp.office365.com)
  • Jira Custom Field has some items that don't work properly
  • tzlocal 3.0b1 not work apscheduler(Adding 'tzlocal<3.0', to setup.py)
  • docker test error
  • slack ssl verification
  • Python 3.9 not work(Change Library blist to sortedcontainers)
  • Even if the rule is disabled, it is not disabled
  • Remains even if the rule is deleted
  • ElastAlert Not enabled even if Disabled to Enabled after restarting
  • Mattermost 400 BAD request error

Python Support version

  • 3.6
  • 3.7
  • 3.8
  • Not Support 3.9(blist not work Python 3.9)

Elasticsearch Support version

  • 6.x
  • 7.x

Configure the elastalert config.yaml with:

  • Your es_host
  • A unique writeback_index
  • Change the rules_folder to rules
cd ~/elastalert
mkdir -p rules rule_templates
chmod -R 777 rules rule_templates
touch rules/BaseRule.config
pip install "setuptools>=11.3"
python setup.py install
cp config.yaml.example config.yaml
vi config.yaml

Setting up the API server

Configure the api server config.json with:

  • An absolute path to your elastalert 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.35.3/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 [email protected]
nvm install 14.15.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

Setting up praeco

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.35.3/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 [email protected]
nvm install 14.15.0
cd ~/praeco
nvm use "$(cat .nvmrc)"
npm install
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.

Maintainers


John Susek

Naoyuki Sano
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].