Spaces method and path for this operation:
post /s/{space_id}/api/osquery/packs
Refer to Spaces for more information.
Create a query pack.
POST
/api/osquery/packs
curl \
--request POST 'https://localhost:5601/api/osquery/packs' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{
"description": "My pack",
"enabled": true,
"name": "my_pack",
"policy_ids": [
"my_policy_id",
"fleet-server-policy"
],
"queries": {
"my_query": {
"ecs_mapping": {
"client.port": {
"field": "port"
},
"tags": {
"value": [
"tag1",
"tag2"
]
}
},
"interval": 60,
"query": "SELECT * FROM listening_ports;",
"timeout": 120
}
},
"shards": {
"fleet-server-policy": 58,
"my_policy_id": 35
}
}'