How jertel/elastalert2 works
ElastAlert 2 evaluates configured rules against Elasticsearch or OpenSearch data and sends notifications when they match. The main workflow is configuration and rule loading, scheduled query/match processing, optional enhancement and aggregation, then alert formatting and delivery. The tree and source index identify the principal modules and several cross-module references; some runtime wiring is not visible in the excerpts, so those relationships are omitted or marked unverified. The README also documents support for both search backends and a broad range of alert destinations.
Main entry points: elastalert.py Scheduler and matcher · loaders.py Rule loading · config.py Configuration · alerters Alert integrations
Components 20
Configuration and rules
- Configuration
elastalert/config.py - Rule loading
elastalert/loaders.py - Rule types
elastalert/ruletypes.py - EQL and ES|QL
elastalert
Detection engine
- Scheduler and matcher
elastalert/elastalert.py - Match enhancements
elastalert/enhancements.py
Search and context
- Elasticsearch / OpenSearch
- Search authentication
elastalert/auth.py - Shared utilities
elastalert/util.py - Index management
elastalert/create_index.py - Discover links
elastalert/kibana_discover.py - OpenSearch Discover
elastalert/opensearch_discover.py - External URL formatters
elastalert - Prometheus metrics
elastalert/prometheus_wrapper.py
Alert delivery
- Alert formatting
elastalert/alerts.py - Alert dispatch
elastalert/elastalert.py - Alert integrations
elastalert/alerters - Alert indexing
elastalert/alerters/indexer.py
Other components
- Rule operator
- Notification services
Connections 19
- Rule operator → Configuration: supplies settings
- Configuration → Rule loading: provides configuration
elastalert/config.py - Rule loading → Rule types: loads rule types
elastalert/loaders.py - Rule loading → Scheduler and matcher: provides rules
- Scheduler and matcher → Elasticsearch / OpenSearch: queries
- Search authentication → Elasticsearch / OpenSearch: authorizes requests
- Scheduler and matcher → Match enhancements: applies enhancements
elastalert/elastalert.py - Scheduler and matcher → Alert dispatch: dispatches matches
elastalert/elastalert.py - Alert dispatch → Alert formatting: formats alerts
elastalert/alerts.py - Alert dispatch → Alert integrations: dispatches alerts
elastalert/elastalert.py - Alert integrations → Notification services: sends notifications
- Alert dispatch → Alert indexing: indexes alerts
- Scheduler and matcher → Discover links: builds Kibana links
elastalert/elastalert.py - Scheduler and matcher → OpenSearch Discover: builds OpenSearch links
elastalert/elastalert.py - Scheduler and matcher → External URL formatters: formats external URLs
elastalert/elastalert.py - Scheduler and matcher → Prometheus metrics: reports metrics
elastalert/elastalert.py - Index management → Elasticsearch / OpenSearch: manages indices
- Scheduler and matcher → Shared utilities: uses helpers
elastalert/elastalert.py - EQL and ES|QL → Scheduler and matcher: supports rule queries
elastalert/util.py