Update pack API

edit

[preview] This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. Update packs.

You are unable to update a prebuilt pack (read_only = true).

Request

edit

PUT <kibana host>:<port>/api/osquery/packs/<id>

PUT <kibana host>:<port>/s/<space_id>/api/osquery/packs/<id>

Path parameters

edit
space_id
(Optional, string) The space identifier. When space_id is not provided in the URL, the default space is used.
id
(Required, string) The ID of the pack you want to update.

Request body

edit
name
(Optional, string) The pack name.
description
(Optional, string) The pack description.
enabled
(Optional, boolean) Enables the pack.
policy_ids
(Optional, array) A list of agent policy IDs.
shards
(Optional, object) An object with shard configuration for policies included in the pack. For each policy, set the shard configuration to a percentage (1–100) of target hosts.
queries
(Required, object) An object of queries.

Response code

edit
200
Indicates a successful call.

Examples

edit

Update a name of the <my_pack> pack:

$ curl -X PUT api/osquery/packs/<id> \
{
  "name": "updated_my_pack_name",
}

The API returns the pack saved object:

{
    "data": {...}
}