grafana-util docs

grafana-util alert clone-rule

What this page covers

Clone an existing staged alert rule into a new authoring target.

When to open this page

  • Reuse an existing rule as a starting point for a variant.
  • Override folder, rule group, receiver, or route behavior while cloning.

Who this page is for

Best for operators who review alert rules, routes, contact points, and staged alert changes.

Purpose

Clone an existing staged alert rule into a new authoring target.

When to use

  • Reuse an existing rule as a starting point for a variant.
  • Override folder, rule group, receiver, or route behavior while cloning.

Key flags

  • --desired-dir points to the staged alert tree.
  • --source identifies the rule to clone.
  • --name sets the new rule name.
  • --folder, --rule-group, --receiver, and --no-route adjust the clone target.
  • --dry-run previews the cloned output.

Examples

# Purpose: Clone an existing staged alert rule into a new authoring target.
grafana-util alert clone-rule --desired-dir ./alerts/desired --source cpu-high --name cpu-high-staging --folder staging-alerts --rule-group cpu --receiver slack-platform
# Purpose: Clone an existing staged alert rule into a new authoring target.
grafana-util alert clone-rule --desired-dir ./alerts/desired --source cpu-high --name cpu-high-staging --dry-run