forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rule execution log support backfill rule run types (elastic#183898)
## Rule execution log support backfill rule run types https://github.com/elastic/kibana/assets/7609147/38662629-d600-449b-949a-2aa0166ea3a1 ### Feature flag `manualRuleRunEnabled` ### Description - Add new column for table with rule run type "Manual" / "Scheduled" - Add new switch to show column with source event time range for backfill run - event execution log api support `run_type_filters` filters as parameter with values like "standard" and "backfill" - event execution log result will return new field for backfill runs - `backfill` ### How to test 1 . Enable feature flag - `manualRuleRunEnabled` 2. For you rule call schedule api `/internal/alerting/rules/backfill/_schedule` `POST` With this body (put your values for rule id and date range): ``` [{"rule_id":"58b4b926-6348-4c23-be1f-870a461fa342","start":"2024-05-21T13:00:00.000Z","end":"2024-05-21T14:05:00.000Z"}] ``` --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
df910f7
commit 69b28f3
Showing
47 changed files
with
1,160 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...rity_solution/common/api/detection_engine/rule_monitoring/model/execution_run_type.gen.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { z } from 'zod'; | ||
|
||
/* | ||
* NOTICE: Do not edit this file manually. | ||
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. | ||
* | ||
* info: | ||
* title: Execution Run Type Schema | ||
* version: not applicable | ||
*/ | ||
|
||
/** | ||
* Type of rule execution run. | ||
*/ | ||
export type RuleRunType = z.infer<typeof RuleRunType>; | ||
export const RuleRunType = z.enum(['backfill', 'standard']); | ||
export type RuleRunTypeEnum = typeof RuleRunType.enum; | ||
export const RuleRunTypeEnum = RuleRunType.enum; |
14 changes: 14 additions & 0 deletions
14
...solution/common/api/detection_engine/rule_monitoring/model/execution_run_type.schema.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: Execution Run Type Schema | ||
version: not applicable | ||
paths: {} | ||
components: | ||
x-codegen-enabled: true | ||
schemas: | ||
RuleRunType: | ||
type: string | ||
description: Type of rule execution run. | ||
enum: | ||
- backfill | ||
- standard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
x-pack/plugins/security_solution/common/detection_engine/rule_management/execution_log.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import type { RuleExecutionStatus, RuleRunType } from '../../api/detection_engine/rule_monitoring'; | ||
import { | ||
RuleExecutionStatusEnum, | ||
RuleRunTypeEnum, | ||
} from '../../api/detection_engine/rule_monitoring'; | ||
|
||
export const RUN_TYPE_FILTERS: RuleRunType[] = [RuleRunTypeEnum.standard, RuleRunTypeEnum.backfill]; | ||
|
||
export const STATUS_FILTERS: RuleExecutionStatus[] = [ | ||
RuleExecutionStatusEnum.succeeded, | ||
RuleExecutionStatusEnum.failed, | ||
RuleExecutionStatusEnum['partial failure'], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 19 additions & 11 deletions
30
...ges/rule_details/execution_log_table/__snapshots__/execution_log_search_bar.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.