Export live query results
- Base URL
-
https://{kibana_url}
- POST /api/osquery/live_queries/{id}/results/{actionId}/_export
Export the results of a live query action as a downloadable file. The response is a streaming file attachment in the requested format.
Request body
Responses
A downloadable file in the requested format. The Content-Disposition header contains the suggested filename.
-
_metaobjectrequired -
Metadata block produced for every export. Included as
_metain the JSON response body and as the first NDJSON line. -
action_idstringrequired -
The action ID (live query) or schedule ID (scheduled query) that produced the results.
-
csv_columnsstringnullable -
For CSV exports with ECS mapping and zero hits: the column header row so an empty export is not a 0-byte file.
-
execution_countintegernullable -
For scheduled query exports only: the execution counter of the scheduled run that produced the results.
-
formatrequired -
The output format for the exported file. Use
ndjsonfor streaming newline-delimited JSON (recommended for large exports),jsonfor a single JSON array (held in memory; suitable for smaller result sets), orcsvfor a comma-separated values file with a header row derived from the ECS mapping. -
Values:
ndjsonjsoncsv
Response Type: string · format: binary
Response Type: string · format: binary
Bad request. Possible causes: invalid or missing format query parameter, malformed KQL in the request body, invalid esFilters, or the result count exceeds the 500,000-row limit.
The authenticated user does not have the osquery-readLiveQueries privilege required to export live query results.