Turn Elasticsearch queries into incidents
Connect clusters, preview bounded queries and monitor their condition through recovery.
Comtinel runs these queries itself. Kibana webhook alerts remain a separate integration. Slack remains a notification and response channel. Each Comtinel workspace can have multiple Elasticsearch connections and rules.
Prepare access to your cluster
Confirm that Elasticsearch integration is available in your workspace. Supported API targets are Elasticsearch 8.12–8.x and 9.x on Elastic Cloud Hosted or self-managed clusters, plus the documented Serverless search API subset. Test your exact cluster version and query workload before enabling production rules. OpenSearch, Elasticsearch 7.x, ES|QL, cross-cluster search and Kibana KQL are not supported here.
Use the Elasticsearch HTTPS endpoint, not a Kibana URL or Elastic Cloud management endpoint. Supply an encoded Elasticsearch API key with index privileges read and view_index_metadata for the exact approved index, alias or data stream patterns. Hosted/self-managed connection information testing also needs cluster monitor. Basic username/password is supported for Hosted/self-managed; Serverless uses an API key. No write, manage or superuser privilege is required. Comtinel does not create or rotate provider credentials automatically.
Public endpoints need a DNS hostname with allowed public IPv4 addresses. For a private cluster, arrange a workspace-specific network connection with Comtinel before adding it. Provide the exact HTTPS origin, permitted addresses and any custom certificate authority. TLS verification remains enabled. Redirects, IP-literal endpoints and IPv6 are not supported.
Connect and discover your data
- 1
Save a connection
Open System → Elasticsearch integration. Enter a recognizable name, HTTPS URL, deployment type, network profile and allowed target patterns such as logs-app-*. Add an API key or supported username/password. Credentials are encrypted, never returned by the settings API, and cleared from the form after save.
- 2
Check access
Choose Check connection. This explicitly contacts the saved cluster and verifies product/version information, scoped metadata and a match-none search. It creates no incident. A failed permission, TLS or network test does not mean the monitored condition has recovered. Saving credentials or connection settings requires another successful check.
- 3
Discover targets and fields
Choose a connection in the rule builder. Enter one to five target names or prefixes, then Discover targets. Indices, aliases and data streams are labelled separately. Choose a name or keep an approved prefix. Discover fields can be narrowed by a field-name prefix. Mapping conflicts and unavailable search/aggregation capabilities are shown; use a searchable date field for time and a compatible numeric field for a metric.
A request can expand to at most 20 concrete indices and return at most 500 discovered fields. Narrow the target or field search when those limits are exceeded. Discovery has no Elasticsearch server-side cursor; bounded responses are searchable by prefix. No matching resource is a configuration error, not an empty successful evaluation.
Build and preview a rule
Enter a Query DSL filter using match_all, bool, term, terms, range, exists, match or match_phrase. Supply only the filter object, for example {"term":{"log.level":"error"}}. Scripts, runtime mappings, fuzzy/wildcard/regexp queries, joins, nested queries, date math in user ranges, search templates, document retrieval and arbitrary aggregations are rejected.
Choose count or avg/sum/min/max on a numeric field, a comparison (gt/gte/lt/lte), one threshold and severity (critical/high/medium/low). Count thresholds must be integers between 0 and 10,000. Counts above 10,000 can be shown as a lower bound and still produce an exact threshold decision. Metrics with no numeric values are no-data errors and retain the current episode; count zero is a valid result.
Intervals are 60–3,600 seconds in whole minutes. Windows are between the interval and 3,600 seconds. Ingestion delay is 0–300 seconds. A UTC-aligned scheduled slot defines a fixed window: [slot − delay − window, slot − delay). Preview uses the latest aligned slot with the same evaluator, query limits and threshold logic. It never changes rule state, creates an incident or sends a notification.
Searches request zero documents and only bounded aggregate scalars. The query AST is limited to 8 KiB, 32 clauses and five levels. Search timeout is three seconds and each HTTP request has a five-second deadline after bounded DNS lookup. These limits reduce load but do not guarantee cluster CPU or immediate cancellation; validate real workloads before rollout.
Enable routing and understand recovery
Save the rule disabled, run preview, then configure a routing rule with source Elasticsearch. Match the configured severity, rule name, rule_id, connection_id or static operational labels. Select your team and escalation policy. Policies use existing SMS, voice, email, panel and configured Slack App delivery. Only authorized Comtinel users or mapped Slack users can ACK or resolve according to their role and assignment.
Enable scheduled queries when ready to create incidents. Rule UUID and connection UUID form stable identity. The first firing evaluation starts an episode; repeated firing and overlapping windows remain the same episode and do not page again. The incident keeps the severity and routing chosen at creation. ACK does not stop source evaluation. Manual resolve suppresses further incidents for that same firing episode. A later successful clear evaluation rearms the rule; a subsequent firing creates a new episode and incident.
Connection errors, authorization failures, timeouts, HTTP 429, partial shards, malformed responses and metric no-data never auto-resolve. Retries are bounded to three attempts for the same window; rate limits honor Retry-After. Late work more than two intervals old is skipped without lifecycle changes; there is no historical catch-up replay. The next current window resumes monitoring.
Query edits preserve the active episode. A connection cannot change URL while rules reference it, and a rule cannot move between connections. Disable cancels unprocessed results and pauses future work without resolving existing incidents. Re-enable with a successful clear evaluation to recover, or manually resolve before removing a disabled rule. Remove rules before removing their connection; removal erases the stored credential ciphertext but does not revoke the provider key. Revoke it separately in Elastic.
Review health and verify a real alert
Dashboard shows connection and evaluation health. Live Watch, Incidents, URL filters and exports support Elasticsearch as a distinct source. Incident detail records rule/connection IDs, the creation window and aggregate threshold value; audit records routing, notifications, ACK, recovery and configuration changes. Rule history retains scalar evaluations for approximately 30 days; no raw Elasticsearch documents are copied into incident or Slack messages.
A workspace can have up to 20 active connections and 100 active rules. Space interactive connection checks at least five seconds apart. Large rule sets can take longer to evaluate; check rule history before assuming a missed notification means a healthy result. A read-only workspace pauses evaluations without resolving existing incidents.
Test a real query on your exact Elasticsearch version and expected data volume. Confirm the alert reaches the intended responder, acknowledge it, clear the query condition and verify recovery. Repeat with a new firing period. If you also use Kibana alerts, test that integration separately; a successful query test does not verify a Kibana connector.
Official references: client compatibility, Hosted and Serverless, privileges, Search API, private connectivity and rejected requests.