﻿---
title: stack kb alerting-v2 patch-alerting-v2-rules-id cli command
description: Update a rule Behaviour flags: --dry-run — validate all inputs and exit without performing any action 
url: https://www.elastic.co/elastic/docs-builder/docs/4075/reference/elastic-cli/cli/stack/kb/alerting-v2/patch-alerting-v2-rules-id
applies_to:
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Preview
---

# stack kb alerting-v2 patch-alerting-v2-rules-id cli command
<cli-modifiers>
</cli-modifiers>

```bash
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

## Options

<definitions>
  <definition term="--id string required">
    The identifier for the rule.
  </definition>
  <definition term="--artifacts string[]">
    Artifacts attached to the rule, each shaped as `{ id, type, data }`. `data` is a type-specific object (for example a `runbook` may carry `content`, a `dashboard` may carry `dashboardId`). Per-type shape is validated by the artifact-type registry when the type is registered; unregistered types pass through with envelope bounds only.
    **Repeatable:** pass `--artifacts` multiple times to supply more than one value
  </definition>
  <definition term="--grouping string">
  </definition>
  <definition term="--metadata string">
  </definition>
  <definition term="--no-data-strategy string">
  </definition>
  <definition term="--query string">
  </definition>
  <definition term="--recovery-strategy string">
  </definition>
  <definition term="--schedule string">
  </definition>
  <definition term="--state-transition string">
  </definition>
  <definition term="--time-field string">
  </definition>
  <definition term="--version string">
    The current version of the rule, used for optimistic concurrency control.
  </definition>
  <definition term="--input-file string">
    path to a JSON file to use as command input
  </definition>
  <definition term="--dry-run">
    validate all inputs and exit without performing any action (preview changes without applying them)
  </definition>
</definitions>


## Global Options

<definitions>
  <definition term="--json">
    output as JSON
  </definition>
</definitions>