Get stream queries Technical Preview; added in 9.1.0

GET /api/streams/{name}/queries

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.

Path parameters

  • name string Required

    The name of the stream.

application/json

Body

object object

Additional properties are NOT allowed.

Responses

  • 200 application/json

    List of queries linked to the 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"
    }
  ]
}