# Event-Rules

**Event Rules** are utilized to automate both new and existing Events within the Case-Hub. Reflex Query Language (RQL) is used by Event Rules to identify and execute certain actions on matching events as they come through. All the created rules can be managed from the Event Rules page.

## Creating an Event Rule

Event Rules can be created from the "Event Rules" page or directly from the "Event-Queue" page, here we will go through the steps for creating an Event Rule from the "Event-Queue" page:

1. Navigate to the **"Event Queue"** page from the dashboard, and identify the event for which you want to create an event rule.
2. Click the **"Blue Graph Icon"** located in the bottom left of the Event card underneath observables, this will open the rule creation wizard, pre-populated with the rule name for the selected event.
3. Enter details, and set **expiration** (if needed).
4. For the Event query, the system will auto-generate a default rule based on selected event observables, check the query, and make required adjustments to the rule.

   Note: Ensure the rule condition is properly tuned and has the fields you need.
5. Click **Test Rule** to test the Rule.
6. Determine **Event actions,**&#x20;
7. Determine **Case actions** (choose between **New/Merge** case options),&#x20;

   Note: choosing the "New-Case" option will create a new case for every event matched.
8. &#x20;Determine **notifications** (if needed).
9. Review the **Event Rule** and click **Create**

## Editing an Event Rule

To modify an Event Rule after creation, the following steps can be used:

1. Navigate to the **Event Rules** page from the **Dashboard**
2. Locate the Event Rule you wish to edit
3. Click **Manage -> Edit Rule**
4. Make required changes and **save**

## Disable an Event Rule

To disable an Event Rule, the following steps can be used:

1. Navigate to the **Event Rules** page from the **Dashboard.**
2. Locate the Event Rule you wish to disable.
3. Click **Manage -> Disable Rule**  (or) toggle the **Active switch** to **`NO`**&#x77;hile editing the rule, save.

## Event Rule Fields

Following are the different fields you need to fill in while creating an event rule:

<table><thead><tr><th width="188">Fields</th><th>Details</th></tr></thead><tbody><tr><td><strong>Organization</strong></td><td>Select the appropriate Organization from the list to apply the Rule to</td></tr><tr><td><strong>Rule Name</strong></td><td>Give the Rule a relevant name</td></tr><tr><td><strong>Rule Descriptio</strong></td><td>provide a description of the Rule and its purpose</td></tr><tr><td><strong>Active</strong></td><td>Rule is actively run against Events</td></tr><tr><td><strong>Protected</strong></td><td>Rule can only be edited and disabled by its creator</td></tr><tr><td><strong>Run Retroactive</strong></td><td>The rule runs retroactively when saved, meaning Case-Hub will attempt to match the Rule to any event that is in the <code>New</code> state</td></tr><tr><td><strong>Global Rule</strong></td><td>Exist in the Default Tenant and will apply to every tenant in the Case-Hub instance</td></tr><tr><td><strong>Priority</strong></td><td><p>Determines which Event Rules will be processed first. </p><p>Rules with a lower-numbered priority will run first, whereas Rules with a high-priority number will run after.</p></td></tr><tr><td><strong>Expire</strong></td><td>The rule will automatically disable itself after <code>x</code> number of days (<code>1</code> is the default)</td></tr><tr><td><strong>Query</strong></td><td>Provide an <a href="/pages/gLyzORATzXUvlkfjzjxd">RQL query</a> to match events to this rule based on certain criteria</td></tr><tr><td><strong>Number of Test Events</strong></td><td><p>Reflex will fetch the last <code>x</code> number of events and compare this rule to them.</p><p></p><p>Event Rules support retroactively testing them against the entire collection of Events in the system. This means that Case-Hub will attempt to test the Rule against all events in <em>any</em> state.<br><br><strong>Best Practices:</strong><br>Testing across a large set of events is time-consuming, it is recommended to fine-tune the testing criteria by selecting a relevant start and end date as well as adjusting the Number of test events to something reasonable (which is 1,000 Events by default).<br><br><strong>Note:</strong> In multi-tenant environments, if the Global Rule is switched to YES, then the test will be done across <em>all</em> tenants.</p></td></tr><tr><td><strong>Start Time</strong></td><td>Start of the search period to test the Rule against</td></tr><tr><td><strong>End Time</strong></td><td>End of the search period to test the Rule against</td></tr><tr><td><strong>Include Results</strong></td><td>This will present all matched Events in a new window</td></tr></tbody></table>

## Event Rule Actions

There are a number of actions that Event Rules can perform when matched to Events. Multiple actions can be applied simultaneously (e.g. an event can be tagged **and** moved into a case at the same time).

<table><thead><tr><th width="208">Event Actions</th><th>Details</th></tr></thead><tbody><tr><td><strong>Dismiss Event</strong></td><td>select a dismiss reason and enter a dismiss comment to automatically dismiss Events that match this Rule</td></tr><tr><td><strong>Add Tags</strong></td><td>Apply additional tags to Events that match this rule</td></tr><tr><td><strong>Update Severity</strong></td><td>Change the severity of the Event that matches the Rule</td></tr></tbody></table>

<table><thead><tr><th width="212">Case Actions</th><th>Details</th></tr></thead><tbody><tr><td><strong>Create New Case</strong></td><td>Creates a new Case for every Event that matches the Rule</td></tr><tr><td><strong>Case Template</strong></td><td>Select a Case Template to apply when the new Case is created</td></tr><tr><td><strong>Merge into Case</strong></td><td>Merges Events that match the Rule into a Case</td></tr></tbody></table>

## Examples

Event Rules are extremely useful for additional automation in your Case-Hub environment and have countless use cases. Below are a few examples:

* Dismiss all successful remote logins where the username is that of a known admin.
* Dismiss benign or known good values for particular Detections.
* Merge all Events generated by a particular Detection into a Case for client review.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.blusapphire.io/older-releases/09_casehub/event-rules.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
