---
title: "Get live queries"
method: GET
path: "/api/osquery/live_queries"
tags: ["Security Osquery API"]
---

# Get live queries

`GET /api/osquery/live_queries`

**Spaces method and path for this operation:**

<div><span class="operation-verb get">get</span>&nbsp;<span class="operation-path">/s/{space_id}/api/osquery/live_queries</span></div>

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Get a list of all live queries.

## Query parameters

- `kuery` string, nullable — The kuery to filter the results by.
- `page` integer, nullable — The page number to return. The default is 1.
- `pageSize` integer, nullable — The number of results to return per page. The default is 20.
- `sort` string, nullable — The field that is used to sort the results.
- `sortOrder` 'asc' | 'desc' — Specifies the sort order.

## Response `200`

Indicates a successful call.

- SecurityOsqueryAPIFindLiveQueryResponse
  - `data` object
    - `items` object[] — An array of live query action items.
      - `_source` object
        - `@timestamp` string, date-time
        - `action_id` string
        - `agents` string[]
        - `expiration` string, date-time
        - `pack_id` string
        - `queries` object[]
          - `action_id` string
          - `agents` string[]
          - `ecs_mapping` SecurityOsqueryAPIECSMapping — Map osquery results columns or static values to Elastic Common Schema (ECS) fields
          - `id` string
          - `query` string
          - `saved_query_id` string
        - `result_counts` object — Result count statistics (present when withResultCounts is true).
          - `error_agents` integer
          - `responded_agents` integer
          - `successful_agents` integer
          - `total_rows` integer
        - `user_id` string
    - `total` integer — The total number of live queries.

---

[API](https://skmtc.net/elastic/apis/kibana-apis.md) · [All operations](https://skmtc.net/elastic/apis/kibana-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/kibana-apis/versions/531c9e2a7d23/schema)
