Get rule details
You must have read
privileges for the appropriate Kibana features, depending on the consumer
and rule_type_id
of the rules you're seeking. For example, the Management > Stack Rules feature, Analytics > Discover and Machine Learning features, Observability features, or Security features. To get rules associated with the Stack Monitoring feature, use the monitoring_user
built-in role.
Path parameters
-
An identifier for the rule.
GET /api/alerting/rule/{ruleId}
curl \
-X GET https://localhost:5601/api/alerting/rule/ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74
Response examples (200)
{
"id": "31697a40-7b36-11ed-aa79-f742c05329b2",
"name": "my alert",
"tags": [
"cpu"
],
"params": {
"index": [
"test-index"
],
"aggType": "avg",
"groupBy": "top",
"aggField": "sheet.version",
"termSize": 6,
"termField": "name.keyword",
"threshold": [
1000
],
"timeField": "@timestamp",
"timeWindowSize": 5,
"timeWindowUnit": "m",
"thresholdComparator": ">"
},
"actions": [
{
"id": "1007a0c0-7a6e-11ed-89d5-abec321c0def",
"uuid": "1c7a1280-f28c-4e06-96b2-e4e5f05d1d61",
"group": "threshold met",
"params": {
"level": "info",
"message": "Rule {{rule.name}} is active for group {{context.group}}:\n\n- Value: {{context.value}}\n- Conditions Met: {{context.conditions}} over {{rule.params.timeWindowSize}}{{rule.params.timeWindowUnit}}\n- Timestamp: {{context.date}",
"connector_type_id": ".server-log"
},
"frequency": {
"summary": false,
"throttle": null,
"notify_when": "onActionGroupChange"
},
"connector_type_id": ".server-log"
}
],
"enabled": true,
"consumer": "alerts",
"last_run": {
"outcome": "succeeded",
"warning": null,
"outcome_msg": null,
"alerts_count": {
"new": 0,
"active": 0,
"ignored": 0,
"recovered": 0
}
},
"mute_all": false,
"next_run": "2022-12-13T22:34:44.314Z",
"revision": 1,
"schedule": {
"interval": "1m"
},
"throttle": null,
"created_at": "2022-12-13T22:33:41.163Z",
"created_by": "elastic",
"updated_at": "2022-12-13T22:33:41.163Z",
"updated_by": "elastic",
"notify_when": null,
"rule_type_id": ".index-threshold",
"api_key_owner": "elastic",
"muted_alert_ids": [],
"execution_status": {
"status": "ok",
"last_duration": 83,
"last_execution_date": "2022-12-13T22:33:44.388Z"
},
"scheduled_task_id": "31697a40-7b36-11ed-aa79-f742c05329b2",
"api_key_created_by_user": false
}
Response examples (401)
{
"error": "Unauthorized",
"message": "string",
"statusCode": 401
}
Response examples (404)
{
"error": "Not Found",
"message": "Saved object [alert/caaad6d0-920c-11ed-b36a-874bd1548a00] not found",
"statusCode": 404
}