Get Query Run Results

POST {{cb_url}}/livequery/v1/orgs/{{cb_org_key}}/runs/{{cb_query_id}}/results/_search?format=csv&download=true

Gets results from a Live Query run. The Live Query results can also be exported as a CSV compressed in a ZIP, or exported asynchronously (see below for details).

RBAC Permissions Required

Permission (.notation name)Operation(s)
livequery.manageREAD

Request

POST <psc-hostname>/livequery/v1/orgs/{org_key}/runs/{id}/results/_search
POST <psc-hostname>/livequery/v1/orgs/{org_key}/runs/{id}/results/_search?format=csv
POST <psc-hostname>/livequery/v1/orgs/{org_key}/runs/{id}/results/_search?format=csv&download=true

Note: The last two routes will stream or download results to a CSV. See Additional Query Parameter Values below for additional information about using the stream or download CSV functionality.

Export Large Jobs Asynchronously

(See Examples in the upper right of Qodex)

You can use the Job Service API (Platform APIs) to download large sets of query results without experiencing timeout errors or receiving corrupt files.

This route can take an optional URL query parameter that tells the server to process the request asynchronously.

When downloading very large sets of query results as CSV, make sure you pass β€œ?format=csv&async=true” as a query parameter to the existing /results/_search route or you may receive errors and corrupt files.

You can only request format=csv when using async=true. - ?format=zip&async=true is not supported

See Documentation

Request Params

KeyDatatypeRequiredDescription
formatstringCSV or ZIP
downloadbooleanCannot pass async AND download
asyncbooleanCannot pass download AND async

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring

RESPONSES

status: OK

{&quot;org_key&quot;:&quot;ABCD1234&quot;,&quot;num_found&quot;:45,&quot;results&quot;:[{&quot;id&quot;:&quot;bxnrsex8dkzq7fw28rmdzhng6mzhczei&quot;,&quot;device&quot;:{&quot;id&quot;:11412673,&quot;name&quot;:&quot;test-machine&quot;,&quot;policy_id&quot;:7113786,&quot;policy_name&quot;:&quot;Standard&quot;,&quot;os&quot;:&quot;WINDOWS&quot;},&quot;status&quot;:&quot;matched&quot;,&quot;time_received&quot;:&quot;2022-11-28T13:45:51.379Z&quot;,&quot;device_message&quot;:&quot;&quot;,&quot;fields&quot;:{&quot;name&quot;:&quot;Privacy Badger&quot;,&quot;path&quot;:&quot;C:\\Users\\Administrator\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\6jmaljui.default-release\\extensions\\jid1-MnnxcxisBPnSXQ@jetpack.xpi&quot;,&quot;version&quot;:&quot;2021.11.23.1&quot;}}]}