Skip to content

Commit e1a7807

Browse files
nastasha-solomonmergify[bot]
authored andcommitted
[8.16] Manual rule run docs (#5631)
* First draft * Removing ESS text changes * just kidding - wrong branch stash * Fixed typo * Limitations and new field * Removing content * Fix table * Updates note * Update docs/detections/rules-ui-manage.asciidoc * Update docs/detections/rules-ui-manage.asciidoc * Update docs/detections/rules-ui-manage.asciidoc * Update docs/detections/rules-ui-monitor.asciidoc * Update docs/detections/rules-ui-monitor.asciidoc * Update docs/reference/alert-schema.asciidoc * Fixed path * Editorial feedback * Removes unecessary term (cherry picked from commit 64d64d7)
1 parent 66b23df commit e1a7807

File tree

6 files changed

+94
-5
lines changed

6 files changed

+94
-5
lines changed

docs/detections/api/rules/rules-api-bulk-actions.asciidoc

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,14 +283,24 @@ to apply.
283283
* `duplicate`
284284
* `export`
285285
* `edit`
286+
* `run`
286287

287288
| Yes
289+
290+
| `run` | <<bulk-manual-rule-run, BulkManualRuleRun[]>>
291+
| Object that describes applying a manual rule run action.
292+
|No.
293+
294+
Yes, if action is `run`.
295+
288296
| `edit` | <<bulk-edit-object-schema, BulkEditAction[]>>
289297
| Edit object that describes applying an update action.
290298

291299
|No.
292300

293301
Yes, if action is `edit`.
302+
303+
294304
| `duplicate` | <<bulk-duplicate-object-schema, BulkDuplicateAction[]>>
295305
| Duplicate object that describes applying an update action.
296306

@@ -308,6 +318,13 @@ To enable dry run mode on a request, add the query parameter `dry_run=true` to t
308318

309319
IMPORTANT: Dry run mode is not supported for the `export` bulk action. A `400` error will be returned in the request response.
310320

321+
[[bulk-manual-rule-run]]
322+
[discrete]
323+
==== BulkManualRuleRun object
324+
325+
* `start_date` field: (String, Required) Defines the start date of the manual run.
326+
* `end_date` field: (String, Optional) Defines the end date of the manual run.
327+
311328
[[bulk-duplicate-object-schema]]
312329
[discrete]
313330
==== BulkDuplicateAction object
@@ -519,14 +536,14 @@ POST api/detection_engine/rules/_bulk_action
519536
[discrete]
520537
===== Response payload
521538

522-
For `enable`, `disable`, `delete`, `edit`, and `duplicate` actions, a JSON object containing the action's outcome:
539+
For `enable`, `disable`, `delete`, `edit`, `duplicate`, and `run` actions, a JSON object containing the action's outcome:
523540

524541
- `attributes.summary.total`: Total number of rules matching the bulk action
525542
- `attributes.summary.succeeded`: Number of successful outcomes (number of rules that were enabled, deleted, or updated)
526543
- `attributes.summary.failed`: Number of failed outcomes
527544
- `attributes.summary.skipped`: Number of rules that were skipped due to various reasons (explained below)
528545
- `attributes.results.created`: Rule objects that were created during the action's execution
529-
- `attributes.results.updated`: Rule objects that were updated during the action's execution
546+
- `attributes.results.updated`: Rule objects that were updated during the action's execution. If the action execution is `run`, it returns rule objects that were scheduled for manual runs.
530547
- `attributes.results.deleted`: Rule objects that were deleted during the action's execution
531548
- `attributes.results.skipped`: Rules that were skipped during the action's execution
532549

111 KB
Loading
158 KB
Loading

docs/detections/rules-ui-manage.asciidoc

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ On the Rules page, you can:
1717
* <<rule-status>>
1818
* <<edit-rules-settings>>
1919
* <<manage-rules-ui>>
20+
* <<manually-run-rules>>
2021
* <<snooze-rule-actions>>
2122
* <<import-export-rules-ui>>
2223
* <<rule-prerequisites>>
@@ -104,6 +105,34 @@ NOTE: When duplicating a rule with exceptions, you can choose to duplicate the r
104105
* To enable or disable a single rule, switch on the rule's *Enabled* toggle.
105106
* To <<snooze-rule-actions,snooze>> actions for rules, click the bell icon.
106107

108+
[float]
109+
[[manually-run-rules]]
110+
=== Run rules manually
111+
112+
beta::[]
113+
114+
Manually run enabled rules for a specified period of time for testing purposes or additional rule coverage.
115+
116+
IMPORTANT: Before manually running rules, make sure you properly understand and plan for rule dependencies. Incorrect scheduling can lead to inconsistent rule results.
117+
118+
1. Navigate to the detection rules page, and do one of the following:
119+
* Select the **All actions** menu (**...**) on a rule, then select **Manual run**.
120+
* Select all the rules you want to manually run, select the **Bulk actions** menu, then select **Manual run**.
121+
. Specify when the manual run starts and ends. The default selection is the current day starting three hours in the past. The rule will search for events during the selected time range.
122+
. Click **Run** to manually run the rule.
123+
+
124+
NOTE: Manual runs can produce multiple rule executions. This is determined by the manual run's time range and the rule's execution schedule.
125+
126+
The manual run's details are shown in the <<manual-runs-table,Manual runs>> table on the *Execution results* tab. Changes you make to the manual run or rule settings will display in the Manual runs table after the current run completes.
127+
128+
[NOTE]
129+
=====
130+
Be mindful of the following:
131+
* Rule actions are not activated during manual runs.
132+
* Except for threshold rules, duplicate alerts aren't created if you manually run a rule during a time range that was already covered by a scheduled run.
133+
* Manual runs are executed with low priority and limited concurrency, meaning they might take longer to complete. This can be especially apparent for rules requiring multiple executions.
134+
=====
135+
107136
[float]
108137
[[snooze-rule-actions]]
109138
=== Snooze rule actions

docs/detections/rules-ui-monitor.asciidoc

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,28 +37,62 @@ For detailed information on a rule, the alerts it generated, and associated erro
3737
[[rule-execution-logs]]
3838
=== Execution results
3939

40-
Each detection rule execution is logged, including its success or failure, any warning or error messages, and how long it took to search for data, create alerts, and complete. This can help you troubleshoot a particular rule if it isn't behaving as expected (for example, if it isn't creating alerts or takes a long time to run).
40+
Each detection rule execution is logged, including the execution type, the execution's success or failure, any warning or error messages, how long it took to search for data, create alerts, and complete. This can help you troubleshoot a particular rule if it isn't behaving as expected (for example, if it isn't creating alerts or takes a long time to run).
4141

42-
To access a rule's execution log, go to *Rules* -> *Detection rules (SIEM)*, click the rule's name to open its details, then scroll down and select the *Execution results* tab. You can expand a long warning or error message by clicking the arrow at the end of a row.
42+
To access a rule's execution log, go to **Rules** → **Detection rules (SIEM)**, click the rule's name to open its details, then scroll down and select the **Execution results** tab. Within the Execution log table, you can click the arrow at the end of a row to expand a long warning or error message.
4343

4444
[role="screenshot"]
45-
image::images/rule-execution-logs.png[Rule execution results tab]
45+
image::images/rule-execution-logs.png[Execution log table on the rule execution results tab]
4646

4747
You can hover over each column heading to display a tooltip about that column's data. Click a column heading to sort the table by that column.
4848

4949
Use these controls to filter what's included in the logs table:
5050

51+
* The **Run type** drop-down filters the table by rule execution type:
52+
** **Scheduled**: Automatic, scheduled rule executions.
53+
** **Manual**: Rule executions that were <<manually-run-rules,started manually>>.
54+
5155
* The *Status* drop-down filters the table by rule execution status:
5256
** *Succeeded*: The rule completed its defined search. This doesn't necessarily mean it generated an alert, just that it ran without error.
5357
** *Failed*: The rule encountered an error that prevented it from running. For example, a {ml} rule whose corresponding {ml} job wasn't running.
5458
** *Warning*: Nothing prevented the rule from running, but it might have returned unexpected results. For example, a custom query rule tried to search an index pattern that couldn't be found in {es}.
5559

5660
* The date and time picker sets the time range of rule executions included in the table. This is separate from the global date and time picker at the top of the rule details page.
5761

62+
* The **Source event time range** button toggles the display of data pertaining to the time range of manual runs.
63+
5864
* The *Show metrics columns* toggle includes more or less data in the table, pertaining to the timing of each rule execution.
5965

6066
* The *Actions* column allows you to show alerts generated from a given rule execution. Click the filter icon (image:images/filter-icon.png[Filter icon,18,17]) to create a global search filter based on the rule execution's ID value. This replaces any previously applied filters, changes the global date and time range to 24 hours before and after the rule execution, and displays a confirmation notification. You can revert this action by clicking *Restore previous filters* in the notification.
6167

68+
[float]
69+
[[manual-runs-table]]
70+
==== Manual runs table
71+
72+
beta::[]
73+
74+
Each manual run can produce multiple rule executions, depending on the time range of the run and the rule's execution schedule. These details are shown in the Manual runs table.
75+
76+
To access the table, navigate to the detection rules page, click the rule's name to open its details, then scroll down and select the **Execution results** tab. Scroll down again to find the Manual runs table.
77+
78+
To stop an active run, go to the appropriate row and click **Stop run** in the **Actions** column. Completed rule executions for each manual run are logged in the Execution log table.
79+
80+
[role="screenshot"]
81+
image::images/manual-rule-run-table.png[Manual rule runs table on the rule execution results tab]
82+
83+
The Manual runs table displays important details such as:
84+
85+
* The status of each manual run:
86+
** **Pending**: The rule is not yet running.
87+
** **Running**: The rule is executing during the time range you specified. Some rules, such as indicator match rules, can take longer to run.
88+
** **Error**: The rule's configuration is preventing it from running correctly. For example, the rule's conditions cannot be validated.
89+
90+
* When a manual run started and the time in which it will run
91+
92+
* The number of rule executions that are failing, pending, running, and completed for a manual run
93+
94+
* The total number of rule executions that are occurring for a manual run
95+
6296
[float]
6397
[[troubleshoot-signals]]
6498
=== Troubleshoot missing alerts

docs/reference/alert-schema.asciidoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,4 +191,13 @@ UIDs are linked to user profiles that are automatically created when users first
191191

192192
Type: string[]
193193

194+
|N/A | `kibana.alert.intended_timestamp` a|
195+
196+
Shows the alert’s estimated timestamp, had the alert been created when the source event initially occurred. The value in this field is determined by the way the rule was run:
197+
198+
* **Scheduled run**: Alerts created by scheduled runs have the same timestamp as the `kibana.alert.rule.execution.timestamp` field, which shows when the rule was executed.
199+
* **Manual run**: Alerts created by manual runs have a timestamp that falls within the time range specified for the manual run. For example, if you set a rule to manually run on event data from `10/01/2024 05:00 PM` to `10/07/2024 05:00 PM`, the `kibana.alert.intended_timestamp` value will be a date and time within that range.
200+
201+
Type: date
202+
194203
|==============================================

0 commit comments

Comments
 (0)