Spaces method and path for this operation:
Refer to Spaces for more information.
Responses
-
Indicates a successful call.
Hide response attributes Show response attributes object
-
Hide actions attributes Show actions attributes object
-
Defines a period that limits whether the action runs.
Additional properties are NOT allowed.
Hide alerts_filter attributes Show alerts_filter attributes object
-
Additional properties are NOT allowed.
Hide query attributes Show query attributes object
-
A filter written in Elasticsearch Query Domain Specific Language (DSL).
-
A filter written in Elasticsearch Query Domain Specific Language (DSL) as defined in the
kbn-es-querypackage.Hide filters attributes Show filters attributes object
-
A filter written in Kibana Query Language (KQL).
-
-
Additional properties are NOT allowed.
Hide timeframe attributes Show timeframe attributes object
-
Defines the days of the week that the action can run, represented as an array of numbers. For example,
1represents Monday. An empty array is equivalent to specifying all the days of the week.Values are
1,2,3,4,5,6, or7. -
Additional properties are NOT allowed.
-
The ISO time zone for the
hoursvalues. Values such asUTCandUTC+1also work but lack built-in support for daylight savings time and are not recommended.
-
-
-
The type of connector. This property appears in responses but cannot be set in requests.
-
Additional properties are NOT allowed.
Hide frequency attributes Show frequency attributes object
-
Indicates how frequently rule actions are triggered. Valid values include:
onActionGroupChange: Actions run when the alert status changes;onActiveAlert: Actions run when the alert becomes active and at each check interval while the rule conditions are met;onThrottleInterval: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. You cannot specifynotify_whenat both the rule and action level. The recommended approach is to set it for each action individually. If you setnotify_whenat the rule level and then edit the rule, it will automatically be converted to action-specific values.Values are
onActionGroupChange,onActiveAlert, oronThrottleInterval. -
Indicates whether the action is a summary.
-
The throttle interval defines how frequently rule actions are triggered. It is specified in seconds, minutes, hours, or days and only applies when 'notify_when' is set to 'onThrottleInterval'. You cannot set the throttle interval at both the rule and action level. The recommended approach is to set it for each action individually. If you set the throttle interval at the rule level and then edit the rule, it will automatically be converted to action-specific values.
-
-
The group name, which affects when the action runs (for example, when the threshold is met or when the alert is recovered). Each rule type has a list of valid action group names. If you don't need to group actions, set to
default. -
The identifier for the connector saved object.
-
The parameters for the action, which are sent to the connector. The
paramsare handled as Mustache templates and passed a default set of context. -
Indicates whether to use alert data as a template.
-
A universally unique identifier (UUID) for the action.
-
-
Indicates that an alert occurs only when the specified number of consecutive runs met the rule conditions.
Additional properties are NOT allowed.
-
Indicates whether the API key that is associated with the rule was created by the user.
-
The owner of the API key that is associated with the rule and used to run background tasks.
-
Additional properties are NOT allowed.
Hide artifacts attributes Show artifacts attributes object
-
Additional properties are NOT allowed.
-
The name of the application or feature that owns the rule. For example:
alerts,apm,discover,infrastructure,logs,metrics,ml,monitoring,securitySolution,siem,stackAlerts, oruptime. -
The date and time that the rule was created.
-
The identifier for the user that created the rule.
-
Indicates whether you want the rule to run on an interval basis after it is created.
-
Additional properties are NOT allowed.
Hide execution_status attributes Show execution_status attributes object
-
Additional properties are NOT allowed.
-
Duration of last rule execution.
-
The date and time of the last rule execution.
-
Status of rule execution.
Values are
ok,active,error,warning,pending, orunknown. -
Additional properties are NOT allowed.
-
-
When flapping detection is turned on, alerts that switch quickly between active and recovered states are identified as “flapping” and notifications are reduced.
Additional properties are NOT allowed.
Hide flapping attributes Show flapping attributes object
-
Determines whether the rule can enter the flapping state. By default, rules can enter the flapping state.
-
The minimum number of runs in which the threshold must be met.
Minimum value is
2, maximum value is20. -
The minimum number of times an alert must switch states within the defined look back window time.
Minimum value is
2, maximum value is20.
-
-
The identifier for the rule.
-
Additional properties are NOT allowed.
Hide last_run attributes Show last_run attributes object | null
-
Additional properties are NOT allowed.
Hide alerts_count attributes Show alerts_count attributes object
-
Outcome of the last rule run. Value can be succeeded, warning, or failed.
Values are
succeeded,warning, orfailed. -
Outcome message generated during last rule run.
-
Order of the outcome.
-
Warning of last rule execution.
Values are
read,decrypt,execute,unknown,license,timeout,disabled,validate,maxExecutableActions,maxAlerts,maxQueuedActions, orruleExecution.
-
-
Indicates whether all alerts are muted.
-
List of identifiers of muted alerts.
-
The name of the rule.
-
Date and time of the next rule run.
-
Indicates how frequently rule actions are triggered. Valid values include:
onActionGroupChange: Actions run when the alert status changes;onActiveAlert: Actions run when the alert becomes active and at each check interval while the rule conditions are met;onThrottleInterval: Actions run when the alert becomes active and at the interval specified in the throttle property while the rule conditions are met. You cannot specifynotify_whenat both the rule and action level. The recommended approach is to set it for each action individually. If you setnotify_whenat the rule level and then edit the rule, it will automatically be converted to action-specific values.Values are
onActionGroupChange,onActiveAlert, oronThrottleInterval. -
The parameters for the rule.
-
The rule revision number.
-
The rule type identifier.
-
Indicates whether the rule is running.
-
Additional properties are NOT allowed.
-
Identifier of the scheduled task.
-
The tags for the rule.
-
Deprecated in 8.13.0. Use the
throttleproperty in the actionfrequencyobject instead. The throttle interval, which defines how frequently rule actions are triggered. You cannot specify the throttle interval at both the rule and action level. If you set the throttle interval at the rule level and then edit the rule, it will automatically be converted to action-specific values. -
The date and time of the latest updates to the rule.
-
The identifier for the user who was the last to update the rule.
-
-
Indicates an invalid schema or parameters.
-
Indicates that this call is forbidden.
-
Indicates a rule with the given ID does not exist.
curl \
--request GET 'https://localhost:5601/api/alerting/rule/{id}' \
--header "Authorization: $API_KEY"
{
"actions": [],
"api_key_owner": "elastic",
"consumer": "alerts",
"created_at": "2022-12-05T23:40:33.132Z",
"created_by": "elastic",
"enabled": true,
"id": "3583a470-74f6-11ed-9801-35303b735aef",
"mute_all": false,
"muted_alert_ids": [],
"name": "my alert",
"notify_when": "onActionGroupChange",
"params": {
"aggField": "sheet.version",
"aggType": "avg",
"groupBy": "top",
"index": [
"test-index"
],
"termField": "name.keyword",
"termSize": 6,
"threshold": [
1000
],
"thresholdComparator": ">",
"timeField": "@timestamp",
"timeWindowSize": 5,
"timeWindowUnit": "m"
},
"revision": 0,
"rule_type_id": ".index-threshold",
"schedule": {
"interval": "1m"
},
"tags": [
"cpu"
],
"throttle": null,
"updated_at": "2022-12-05T23:40:33.132Z",
"updated_by": "elastic"
}