Export detection rules

Base URL
https://{kibana_url}
  • POST /api/detection_engine/rules/_export
  • POST /s/{space_id}/api/detection_engine/rules/_export
Auth

Export detection rules to an .ndjson file. The following configuration items are also included in the .ndjson file:

  • Actions
  • Exception lists
Note

Rule actions and connectors are included in the exported file, but sensitive information about the connector (such as authentication credentials) is not included. You must re-add missing connector details after importing detection rules.

You can use Kibana’s Saved Objects UI (Stack Management → Kibana → Saved Objects) or the Saved Objects APIs (experimental) to export and import any necessary connectors before importing detection rules.

Similarly, any value lists used for rule exceptions are not included in rule exports or imports. Use the Manage value lists UI (Rules → Detection rules (SIEM) → Manage value lists) to export and import value lists separately.

Path parameters

space_id string optional

An identifier for the space. If space_id is not provided in the URL, the default space is used. Refer to Spaces for more information.

Query parameters

exclude_export_details boolean · default: false

Determines whether a summary of the exported rules is returned.

file_name string · default: export.ndjson

File name for saving the exported rules.

Note

When using cURL to export rules to a file, use the -O and -J options to save the rules to the file name specified in the URL.

Request body

objects object[] required

Array of objects with a rule's rule_id field. Do not use rule's id here. Exports all rules when unspecified.

rule_id string required

A stable unique identifier for the rule object. It can be assigned during rule creation. It can be any string, but often is a UUID. It should be unique not only within a given Kibana space, but also across spaces and Elastic environments. The same prebuilt Elastic rule, when installed in two different Kibana spaces or two different Elastic environments, will have the same rule_ids.

Response

Indicates a successful call.

application/ndjson

Response Type: string · format: binary

Base URL
https://{kibana_url}