导入异常列表
编辑导入异常列表编辑
导入异常列表和关联项目。
异常列表将异常项目分组,并可以与规则关联。当异常项目的查询结果为true
时,即使关联规则的其他条件也满足,也不会发出警报。
您可以将多个异常列表分配给检测规则。有关更多信息,请参阅创建规则和更新规则.
添加到同一列表中的所有异常项目都使用OR
逻辑进行评估。这意味着如果列表中的任何项目评估为true
,则会阻止规则生成警报。同样,当将多个异常列表分配给规则时,也会使用OR
逻辑来评估异常。要使用AND
运算符,可以在单个异常项目中定义多个子句(entries
)。
请求 URL编辑
POST <kibana 主机>:<端口>/api/exception_lists/_import
请求必须包含
- 指向包含异常列表的
.ndjson
文件的链接。
例如,使用 cURL
curl -X POST "<KibanaURL>/api/exception_lists/_import" -u <username>:<password> -H 'kbn-xsrf: true' --form "file=@<link to file>"
URL 查询参数编辑
名称 | 类型 | 描述 | 必需 |
---|---|---|---|
|
布尔值 |
确定是否覆盖具有相同 |
否,默认为 |
|
布尔值 |
确定导入的列表是否会生成新的 |
否,默认为 |
示例请求编辑
导入exception_lists.ndjson
文件中的异常列表,并覆盖具有相同list_id
值的现有列表
响应代码编辑
-
200
- 表示调用成功。
响应有效负载编辑
{ "errors": [], "success": true; "success_count": 1; "success_exception_lists": 1; "success_count_exception_lists": 1; "success_exception_list_items": true; "success_count_exception_list_items": 1; }
示例 ndjson 文件编辑
{"_version":"WzEyOTcxLDFd","created_at":"2021-10-19T22:16:22.426Z","created_by":"elastic","description":"Query with a rule_id that acts like an external id","id":"3120bfa0-312a-11ec-9af9-ebd1fe0a2379","immutable":false,"list_id":"7d7cccb8-db72-4667-b1f3-648efad7c1ee","name":"Query with a rule id Number 1","namespace_type":"single","os_types":[],"tags":[],"tie_breaker_id":"e4daafa2-a60b-4e97-8eb4-2ed54356308f","type":"detection","updated_at":"2021-10-19T22:16:22.491Z","updated_by":"elastic","version":1} {"_version":"WzEyOTc1LDFd","comments":[],"created_at":"2021-10-19T22:16:36.567Z","created_by":"elastic","description":"Query with a rule id Number 1 - exception list item","entries":[{"field":"@timestamp","operator":"included","type":"exists"}],"id":"398ea580-312a-11ec-9af9-ebd1fe0a2379","item_id":"f7fd00bb-dba8-4c93-9d59-6cbd427b6330","list_id":"7d7cccb8-db72-4667-b1f3-648efad7c1ee","name":"Query with a rule id Number 1 - exception list item","namespace_type":"single","os_types":[],"tags":[],"tie_breaker_id":"54fecdba-1b36-467a-867c-a49aaaa84dcc","type":"simple","updated_at":"2021-10-19T22:16:36.634Z","updated_by":"elastic"}