You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Import rules from json, toml, yaml, or Kibana exported rule file(s).
86
88
87
89
Options:
88
-
--required-only Only prompt for required fields
89
-
-d, --directory DIRECTORY Load files from a directory
90
-
-h, --help Show this message and exit.
90
+
-ac, --action-connector-import Include action connectors in export
91
+
-e, --exceptions-import Include exceptions in export
92
+
--required-only Only prompt for required fields
93
+
-d, --directory DIRECTORY Load files from a directory
94
+
-s, --save-directory DIRECTORY Save imported rules to a directory
95
+
-se, --exceptions-directory DIRECTORY
96
+
Save imported exceptions to a directory
97
+
-sa, --action-connectors-directory DIRECTORY
98
+
Save imported actions to a directory
99
+
-ske, --skip-errors Skip rule import errors
100
+
-da, --default-author TEXT Default author for rules missing one
101
+
-snv, --strip-none-values Strip None values from the rule
102
+
-h, --help Show this message and exit.
91
103
```
92
104
93
105
The primary advantage of using this command is the ability to import multiple rules at once. Multiple rule paths can be
@@ -97,10 +109,14 @@ a combination of both.
97
109
In addition to the formats mentioned using `create-rule`, this will also accept an `.ndjson`/`jsonl` file
98
110
containing multiple rules (as would be the case with a bulk export).
99
111
112
+
The `-s/--save-directory` is an optional parameter to specify a non default directory to place imported rules. If it is not specified, the first directory specified in the rules config will be used.
113
+
100
114
This will also strip additional fields and prompt for missing required fields.
101
115
102
116
<aid="note-3">\* Note</a>: This will attempt to parse ALL files recursively within a specified directory.
103
117
118
+
Additionally, the `-e` flag can be used to import exceptions in addition to rules from the export file.
119
+
104
120
105
121
## Commands using Elasticsearch and Kibana clients
106
122
@@ -165,6 +181,8 @@ Options:
165
181
-h, --help Show this message and exit.
166
182
167
183
Commands:
184
+
export-rules Export custom rules from Kibana.
185
+
import-rules Import custom rules into Kibana.
168
186
search-alerts Search detection engine alerts with KQL.
169
187
upload-rule Upload a list of rule .toml files to Kibana.
This command should be run with the `CUSTOM_RULES_DIR` envvar set, that way proper validation is applied to versioning when the rules are downloaded. See the [custom rules docs](docs/custom-rules.md) for more information.
0 commit comments