
kibana-alerting-rules
Create and manage Kibana alerting rules. Use when creating, updating, or managing rule lifecycle (enable, disable, mute, snooze), choosing metric threshold rule types and params, or read-only find/list with tag filters.
- Installs
- 4K
- Last 24h
- +21
- Trending rank
- #5686
- Security
- Pass
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/elastic/agent-skills --skill kibana-alerting-rules- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads kibana-alerting-rules automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
Security audits
Independent scans of the skill's instructions and bundled files.
SKILL.md
The instructions your agent reads when the skill is triggered.
Kibana Alerting Rules
Create, inspect, update, and manage Kibana alerting rules: choose the right rule type, encode threshold and grouping semantics, attach actions only when requested, and list or filter rules read-only when the user asks to discover existing coverage.
<!-- begin-partial: preamble -->Environment Configuration
This skill executes Elasticsearch operations through the elastic CLI. If the
elastic CLI is not installed, tell the user what it is needed for. Do
not guess credentials, call the HTTP API directly, or attempt other workarounds.
This skill references operations in HTTP-shorthand form (e.g., GET /, GET /_cat/indices, GET /{index}/_mapping,
GET /{index}/_settings/index.mode, POST /_query). The Operations table at the end of this document
maps each shorthand to the equivalent elastic CLI command — always use the CLI rather than calling the HTTP API
directly.
Core concepts
A rule has three parts: conditions (params + rule_type_id), schedule (how often conditions are checked), and
actions (optional connectors run when alerts fire). When conditions are met, the rule creates alerts; actions
deliver notifications through connectors. Do not create connectors or actions unless the user explicitly asks for
notification wiring — many tasks require only the rule definition.
Required privileges: all on the owning Kibana feature (Stack Rules, Observability, Security, etc.) and all on Rules
Settings. Managing connectors needs all on Actions and Connectors; read is sufficient to attach existing connectors
as rule actions.
On-premises prerequisite: configure a stable xpack.encryptedSavedObjects.encryptionKey in kibana.yml before
creating rules — it encrypts rule API keys and connector secrets. If it is unset, each restart regenerates it and breaks
existing rules; all Kibana nodes in a cluster must share the same key.
Process
-
Classify the task. Decide whether the user needs to create a rule, find/list rules (read-only), update an existing rule, or perform a lifecycle change (enable, disable, mute, snooze, delete). If the user only asks to show or list rules, treat the request as read-only — do not create, update, enable, or delete anything.
-
For find/list tasks, filter and page sensibly. Call
GET kbn:/api/alerting/rules/_findwith query parameters that narrow results instead of dumping every rule:- By tag:
filter=alert.attributes.tags:"production"(KQL on saved-object attributes). - By text:
searchwithsearch_fieldsanddefault_search_operatoras needed. - Paging: set
per_pageand iteratepagewhen results may exceed one page. - Sort:
sort_field=nameandsort_order=ascfor stable listings.
Enumerate matching rule ids and names. If no rules match, say so plainly — do not invent results. Query alerting rules specifically, not connectors or streams.
- By tag:
-
For create tasks, choose the rule type before writing params. Match the user's intent to a metric/threshold rule type — not log, anomaly, or unrelated types:
- Numeric metric over a time window, optionally per host/service →
.index-thresholdwithconsumer: "stackAlerts". - Document count or Query DSL condition →
.es-querywithconsumer: "stackAlerts". - Observability metric in the metrics app →
metrics.alert.thresholdwithconsumer: "metrics"or"infrastructure".
Read rule-types-reference.md for param schemas, valid consumers, and action groups. When the user specifies an index, field, threshold, duration, and grouping field, encode all four explicitly in
params— do not substitute a connector or action for the condition. - Numeric metric over a time window, optionally per host/service →
-
Encode threshold, duration, and grouping correctly. These three dimensions are independent:
- Threshold: set
thresholdandthresholdComparatoron the aggregated value. Match field scale — ECSsystem.cpu.total.pctis typically fractional (0.9for 90%); use90only when the field is on a 0–100 scale. - "For N minutes" semantics: set
timeWindowSizeandtimeWindowUnitinparams(lookback evaluated each run). Alignschedule.intervalwith that window (e.g., both five minutes) so a brief spike does not fire on a mismatched cadence. Addalert_delay: {"active": N}only when the user wants N consecutive matching runs, not a single lookback window. - Per-host / per-entity grouping: for
.index-threshold, setgroupBy: "top",termFieldto the grouping field (e.g.,host.name), and atermSizelarge enough to cover all entities ("any host"). Without grouping, the rule aggregates globally and will not alert per host.
- Threshold: set
-
Build the create payload. Required fields:
name,rule_type_id,consumer,schedule,params. Optional:tags,enabled,actions,alert_delay,flapping. Use the user-supplied rule id in the URL when given; otherwise let Kibana generate one.Example params — CPU > 90% on any host for 5 minutes on
eval-alert-metrics:{ "name": "CPU exceeds 90% for 5 minutes", "rule_type_id": ".index-threshold", "consumer": "stackAlerts", "schedule": { "interval": "5m" }, "params": { "index": ["eval-alert-metrics"], "timeField": "@timestamp", "aggType": "avg", "aggField": "system.cpu.total.pct", "groupBy": "top", "termField": "host.name", "termSize": 1000, "threshold": [0.9], "thresholdComparator": ">", "timeWindowSize": 5, "timeWindowUnit": "m" }, "tags": ["production"] }Omit
actionswhen the user only asks to create the rule condition. -
Create and confirm. Call
POST kbn:/api/alerting/rule/{id}with the payload. On 409 Conflict, the id already exists — callGET kbn:/api/alerting/rule/{id}to inspect or choose a different id. After a successful create, callGET kbn:/api/alerting/rule/{id}and confirm success to the user with the live rule id, name, and enabled state — do not claim success without verifying on Kibana. -
For update tasks, read then replace.
rule_type_idandconsumerare immutable. CallGET kbn:/api/alerting/rule/{id}, merge intended changes, thenPUT kbn:/api/alerting/rule/{id}with the complete rule body. On 409 Conflict, another user changed the rule — re-fetch and retry. Set per-actionfrequencyobjects; rule-levelnotify_whenandthrottleare deprecated. -
For lifecycle tasks, call the narrowest endpoint. Disable temporarily with
POST kbn:/api/alerting/rule/{id}/_disable(rule retains config); re-enable withPOST kbn:/api/alerting/rule/{id}/_enable. Mute all alerts withPOST kbn:/api/alerting/rule/{id}/_mute_all; restore withPOST kbn:/api/alerting/rule/{id}/_unmute_all. Mute a single active alert withPOST kbn:/api/alerting/rule/{rule_id}/alert/{alert_id}/_mute; unmute withPOST kbn:/api/alerting/rule/{rule_id}/alert/{alert_id}/_unmute. Schedule snoozes withPOST kbn:/api/alerting/rule/{id}/snooze_schedule; remove withDELETE kbn:/api/alerting/rule/{ruleId}/snooze_schedule/{scheduleId}. Delete permanently withDELETE kbn:/api/alerting/rule/{id}. When a rule fails due to API key ownership, callPOST kbn:/api/alerting/rule/{id}/_update_api_key.
Examples
Create a threshold alert
User: "Alert me when CPU exceeds 90% on any host for 5 minutes. Query eval-alert-metrics (system.cpu.total.pct,
grouped by host.name). Create the rule with id eval-cpu-rule."
- Choose
.index-threshold/stackAlerts. - Encode fractional threshold
[0.9], five-minutetimeWindowSize/timeWindowUnit, andgroupBy/termFieldforhost.name. POST kbn:/api/alerting/rule/eval-cpu-rulewithschedule.interval: "5m". Omit actions.GET kbn:/api/alerting/rule/eval-cpu-ruleand confirm to the user.
Find rules by tag (read-only)
User: "Show me all production alerting rules."
GET kbn:/api/alerting/rules/_findwithfilter=alert.attributes.tags:"production", sensibleper_page, andsort_field=name.- Page through results if
totalexceedsper_page. - Report ids and names only — no mutations.
Pause a rule temporarily
User: "Disable rule abc123 until next Monday."
POST kbn:/api/alerting/rule/abc123/_disable.- Re-enable later with
POST kbn:/api/alerting/rule/abc123/_enable.
For planned downtime spanning multiple rules, prefer a maintenance window over disabling or snoozing each rule individually.
Guidelines
- Set
frequencyinside each action object — rule-levelnotify_whenandthrottleare deprecated. rule_type_idandconsumerare immutable after creation; delete and recreate to change them.- Prefix paths with
kbn:/s/<space_id>/api/alerting/for non-default Kibana Spaces (connectors are space-scoped too). - A rule action cannot reference a connector from a different space — the rule and its connectors must share one Space.
- Pair active notification actions with a Recovered action for PagerDuty, Jira, and ServiceNow.
- Use
alert_delayto require consecutive matches; use flapping settings to suppress unstable alerts. Per-rule tuning via theflappingobject is GA since 9.3; earlier versions support only space-level flapping settings. - Debug action templates with
{{{.}}}in any template field — it renders the whole variable context as JSON, which helps discover correct paths like{{context.reason}}or{{alert.flapping}}. - Do not use this skill for Security detection rules:
consumer: "securitySolution"/"siem"belongs to the dedicated Security Detections API (/api/detection_engine/rules), which has different rule type ids and lifecycle. - Tag rules consistently (
production,staging, team names) for find API filtering. - Minimum recommended check interval is
1m; expensive rules are cancelled after the server run timeout (default5m).
Common pitfalls
- Wrong rule type — using a log or ML rule for a metric threshold condition.
- Missing per-entity grouping — global aggregation when the user asked for "any host" or "per service".
- Threshold scale mismatch —
90vs0.9on fractional CPU fields. - Duration conflated with schedule — a one-minute schedule with a five-minute window behaves differently from both set to five minutes.
- Unrequested actions — attaching connectors when the user only asked to create the rule.
- Read-only violations — creating or mutating rules when the user asked only to list or filter.
- Concurrent update conflicts — PUT without a fresh GET returns 409.
- Import/export — saved-object import disables rules and strips connector secrets.
References
- rule-types-reference.md — Rule types, params, consumers, action groups
- connectors-actions-terraform.md — Actions, workflows, Terraform
- Kibana Alerting API
- Alerting concepts
- Rule action variables
- Alerting production considerations
Operations
| HTTP API (shorthand) | elastic CLI command |
|---|---|
GET kbn:/api/alerting/rules/_find | elastic kb alerting get-alerting-rules-find [--filter '<kql>'] [--search '<q>'] [--per-page <n>] [--page <n>] [--sort-field <field>] [--sort-order asc|desc] |
POST kbn:/api/alerting/rule/{id} | elastic kb alerting post-alerting-rule-id --id '<id>' --name '<name>' --rule-type-id '<type>' --consumer '<consumer>' --schedule '<json>' --params '<json>' [--tags '<json>'] [--actions '<json>'] [--enabled] |
GET kbn:/api/alerting/rule/{id} | elastic kb alerting get-alerting-rule-id --id '<id>' |
PUT kbn:/api/alerting/rule/{id} | elastic kb alerting put-alerting-rule-id --id '<id>' --name '<name>' --schedule '<json>' --params '<json>' [--tags '<json>'] [--actions '<json>'] |
DELETE kbn:/api/alerting/rule/{id} | elastic kb alerting delete-alerting-rule-id --id '<id>' |
POST kbn:/api/alerting/rule/{id}/_enable | elastic kb alerting post-alerting-rule-id-enable --id '<id>' |
POST kbn:/api/alerting/rule/{id}/_disable | elastic kb alerting post-alerting-rule-id-disable --id '<id>' [--untrack] |
POST kbn:/api/alerting/rule/{id}/_mute_all | elastic kb alerting post-alerting-rule-id-mute-all --id '<id>' |
POST kbn:/api/alerting/rule/{id}/_unmute_all | elastic kb alerting post-alerting-rule-id-unmute-all --id '<id>' |
POST kbn:/api/alerting/rule/{id}/_update_api_key | elastic kb alerting post-alerting-rule-id-update-api-key --id '<id>' |
POST kbn:/api/alerting/rule/{rule_id}/alert/{alert_id}/_mute | elastic kb alerting post-alerting-rule-rule-id-alert-alert-id-mute --rule-id '<rule_id>' --alert-id '<alert_id>' |
POST kbn:/api/alerting/rule/{rule_id}/alert/{alert_id}/_unmute | elastic kb alerting post-alerting-rule-rule-id-alert-alert-id-unmute --rule-id '<rule_id>' --alert-id '<alert_id>' |
POST kbn:/api/alerting/rule/{id}/snooze_schedule | elastic kb alerting post-alerting-rule-id-snooze-schedule --id '<id>' --schedule '<json>' |
DELETE kbn:/api/alerting/rule/{ruleId}/snooze_schedule/{scheduleId} | elastic kb alerting delete-alerting-rule-ruleid-snooze-schedule-scheduleid --rule-id '<ruleId>' --schedule-id '<scheduleId>' |
FAQ
What does the kibana-alerting-rules skill do?
Create and manage Kibana alerting rules. Use when creating, updating, or managing rule lifecycle (enable, disable, mute, snooze), choosing metric threshold rule types and params, or read-only find/list with tag filters.
How do I install kibana-alerting-rules?
Run npx skills add https://github.com/elastic/agent-skills --skill kibana-alerting-rules in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/kibana-alerting-rules/ (personal) or .claude/skills/kibana-alerting-rules/ (project).
Which AI agents can use kibana-alerting-rules?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is kibana-alerting-rules safe to install?
Security partners have reviewed it: Gen Agent Trust Hub passed; Socket passed; Snyk passed; Runlayer passed. As with any skill, read the SKILL.md and bundled scripts before installing.
Who maintains kibana-alerting-rules?
It is published by elastic in elastic/agent-skills. It has 4,024 recorded installs.
More from elastic/agent-skills
elasticsearch-esql
elastic/agent-skills
Execute ESQL (Elasticsearch Query Language) queries, use when the user wants to query Elasticsearch data, analyze logs, aggregate metrics, explore data, or create charts and dashboards from ESQL results.
elasticsearch-onboarding
elastic/agent-skills
Help developers new to Elasticsearch get from zero to a working search experience. Guide them through understanding their intent, mapping their data, and building a search experience with best practices baked in. Use this when the user shows intent to build search-related functionality, asks about Elasticsearch-related concepts for their use case, or expresses the need for help getting started with Elasticsearch.
kibana-dashboards
elastic/agent-skills
Create and manage Kibana Dashboards and Lens visualizations. Use when you need to define dashboards and visualizations declaratively, version control them, or automate their deployment.
security-case-management
elastic/agent-skills
Create, search, update, and manage SOC cases via the Kibana Cases API. Use when tracking incidents, linking alerts to cases, adding investigation notes, or managing triage output.
kibana-agent-builder
elastic/agent-skills
Create and manage Kibana Agent Builder agents and custom tools. Use when asked to create, update, delete, test, or inspect agents or tools in Agent Builder, or when the user wants to understand what agents or tools already exist.
observability-llm-obs
elastic/agent-skills
Answer questions about LLM and agentic-application behavior from data already ingested into Elastic: latency and error rate, token and cost utilization, response quality and guardrail events, and agentic call-chain orchestration. Use when the user asks about LLM monitoring, GenAI observability, token spend or AI cost, model latency, prompt or guardrail failures, or how an agent's tool-call chain executed.
Popular ai & agents skills
google-agents-cli-publish
google/agents-cli
This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).
google-agents-cli-eval
google/agents-cli
This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).
skill-creator
anthropics/skills
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
codex-pet
prime-skills/runcomfy-agent-skills
Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.
full-output-enforcement
leonxlnx/taste-skill
Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.
executing-plans
obra/superpowers
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available