Skip to main content

Module alerts_ops

Module alerts_ops 

Source
Expand description

Alert orchestration: filter construction, list/get, and the triage mutation plans behind the CLI guard.

Structs§

AlertFilter
The alerts list filter set. Every field composes into one boolean query over the measured kibana.alert.* fields (triage spec section 4).
AlertList
AssignPlan
EditReport
The tags/assignees report: the same counters without a target status.
QueryStatusPlan
ResolvedAlert
One explicitly named alert, resolved before a preview.
StatusPlan
StatusReport
The mutation report the CLI renders. failed is elasticctl’s judgment — route failures plus, under --conflicts abort, version conflicts — and drives the non-zero exit; the verbatim counters render beside it.
TagsPlan

Constants§

QUERY_SAMPLE_SIZE
RESOLVE_SOURCE_FIELDS
_source fields resolve_ids requests: only what a mutation preview renders (rule name and current workflow status), not the whole document. pub so the fixture recorder can send the identical production body instead of a hand-rolled approximation (triage spec section 10).

Functions§

apply_assign
apply_status_by_ids
apply_status_by_query
apply_tags
build_query
Compose the filter into one boolean query, resolving rule and assignee first. An empty filter is an explicit match_all.
default_sort
Newest first, with kibana.alert.uuid as the total-order tiebreaker search_after needs.
export
The --out path: page the filtered set fully, or stop at limit rows when the caller passes one (matching search dsl --out --limit).
get_one
alerts get: an _id-filtered search returning one document.
list
One bounded peek: limit + 1 rows so truncation is observable without a second request.
plan_assign
plan_status_by_ids
plan_status_by_query
Resolve the operator’s query to a count and a sample so the implicit set is visible before it is mutated (triage spec section 6).
plan_tags
since_clause
--since as a range clause: <digits><s|m|h|d|w> becomes now-<dur>; anything else passes through verbatim for the server to validate as a timestamp or date-math expression.