stack kb alerting-v2 put-alerting-v2-rules-id cli command
Auth required
Idempotent
Scope: global
elastic stack kb alerting-v2 put-alerting-v2-rules-id \
--id <id> \
--kind <kind> \
--metadata <metadata> \
--query <query> \
--schedule <schedule> \
[options]
Create or replace a rule
Behaviour flags:
--dry-run — validate all inputs and exit without performing any action
--idstringrequired- The identifier for the rule.
--kindstringrequired- The kind of the rule.
--metadatastringrequired--querystringrequired--schedulestringrequired--artifactsstring[]- Artifacts attached to the rule, each shaped as
{ id, type, data }.datais a type-specific object (for example arunbookmay carrycontent, adashboardmay carrydashboardId). Per-type shape is validated by the artifact-type registry when the type is registered; unregistered types pass through with envelope bounds only. --groupingstring--no-data-strategystring- How to handle no-data situations. "last_known_status" holds the last known status; "recover" forces recovery; "none" disables no-data detection. "emit" is not currently accepted by the create/update API. Standalone-format rules must provide a
no_dataquery block when this is not "none"; composed-format rules usebaseas the data-presence query. --recovery-strategystring- How recovery is detected. "no_breach" recovers groups that stop breaching; "query" uses a custom recovery query; "none" disables recovery.
--state-transitionstring- Episode state transition thresholds (alert-only).
--time-fieldstring- Time field used for the lookback window range filter.
--input-filestring- path to a JSON file to use as command input
--dry-run- validate all inputs and exit without performing any action (preview changes without applying them)
--json-
output as JSON