Body
Required
-
When
true
, the query runs on all agents. -
A list of agent IDs to run the query on.
-
A list of agent platforms to run the query on.
-
A list of agent policy IDs to run the query on.
-
A list of alert IDs associated with the live query.
-
A list of case IDs associated with the live query.
-
Map osquery results columns or static values to Elastic Common Schema (ECS) fields
-
A list of event IDs associated with the live query.
-
Custom metadata object associated with the live query.
-
The ID of the pack you want to run, retrieve, update, or delete.
-
An array of queries to run.
-
The SQL query you want to run.
-
The ID of a saved query.
POST
/api/osquery/live_queries
curl \
--request POST 'https://<KIBANA_URL>/api/osquery/live_queries' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"query":"select * from uptime;","agent_all":true,"ecs_mapping":{"host.uptime":{"field":"total_seconds"}}}'