stack kb alerting-v2 patch-alerting-v2-rules-id cli command
Auth required
elastic stack kb alerting-v2 patch-alerting-v2-rules-id --id <id> [options]
Update a rule
Behaviour flags:
--dry-run — validate all inputs and exit without performing any action
--idstringrequired- The identifier for the rule. Chosen at creation and permanent — it cannot be changed afterwards. Re-using the id of a deleted resource is allowed but discouraged: execution history, change history, and alerts recorded under that id are retained and are attributed to the new resource. Ids appear in URLs and logs, so keep them free of sensitive data.
--artifactsstring[]-
Optional objects attached to the rule, such as a runbook or a dashboard. Each item has
id,type, anddata. The shape ofdatadepends ontype. For example, arunbookusescontentand adashboardusesdashboard_id. Known types are validated against that shape. Unknown types are stored whenid,type, anddataare present. An empty array is rejected: omitartifactson create, or sendnullon PATCH to clear.Repeatable: pass
--artifactsmultiple times to supply more than one value --groupingstring- Grouping configuration.
--metadatastring--no-datastring- What the rule does when a group has no data. Required when
kindisalert. Not allowed whenkindissignal. Any strategy other thanignorerequires eitherquery.breachorno_data.query, so that a group with no data can be told apart from one that stopped breaching. --querystring--recoverystring- When an alert recovers. Required when
kindisalert. Not allowed whenkindissignal. --schedulestring--state-transitionstring- Specifies how many consecutive matches, or how long a condition must hold, before an alert becomes
activeorinactive. Allowed only whenkindisalert. --time-fieldstring- Document field Kibana uses with
schedule.lookbackto time-filterquery.base. --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)
--no-validate- skip input validation and send the request as-is
--output-fieldsstring- comma-separated list of fields to include in output (dot-notation supported)
--output-templatestring- Mustache-like template for custom text output (e.g. "{{id}}: {{name}}")
--json-
output as JSON