Spaces method and path for this operation:
get /s/{space_id}/api/streams/{name}/queries
Refer to Spaces for more information.
Fetches all queries linked to a stream that are visible to the current user in the current space.
[Required authorization] Route required privileges: read_stream.
GET
/api/streams/{name}/queries
curl \
--request GET 'https://localhost:5601/api/streams/{name}/queries' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json"
Response examples (200)
{
"queries": [
{
"description": "Count error-level log events grouped by host name",
"esql": {
"query": "FROM logs.nginx | WHERE log.level == \"error\" | STATS count = COUNT(*) BY host.name"
},
"id": "error-count-by-host",
"severity_score": 75,
"title": "Error count by host",
"type": "match"
},
{
"description": "Requests with response time above 2 seconds",
"esql": {
"query": "FROM logs.nginx | WHERE http.response_time > 2000"
},
"id": "high-latency-requests",
"severity_score": 50,
"title": "High latency requests",
"type": "match"
}
]
}