Get the Elasticsearch query for a rule
- Base URL
-
https://{kibana_url}
-
GET
/api/alerting/rule/{id}/query_inspector
Auth
Returns the Elasticsearch query that a rule executes, and optionally its response.
-
id
string
required
-
The identifier for the rule.
-
mode
enum · default: build
-
The inspection mode. Use "build" to return only the query, or "execute" to run the query and include the response.
-
Values:
build
execute
-
alert_id
string
-
The alert document ID. When provided, the query inspector uses the evaluation time range from the alert instead of the current time.
Indicates a successful call.
application/json
-
queries
object[] · max items: 1000
required
-
-
request
map string to object
required
-
response
map string to object
400
Indicates the rule type is not supported or the request parameters are invalid.
404
Indicates a rule with the specified rule ID does not exist.