Event selection criteria


While creating a policy, it is important to select the right criteria to generate events. Use the following section to learn about the event selection criteria as you create a policy.


To view the event selection criteria, select Configuration > Event Policies and click Create.

When you click in the Event Selection Criteria box, you are prompted to make a selection. Each time you make a selection, you are progressively prompted to make another selection. 

The selection criteria consist of an opening parenthesis, followed by the slot name, the operator, the slot value (which can be a string based on the type of slot selected), and the closing parenthesis. Use the No Bracket (default) option to specify criteria conditions in a simplified manner. You can optionally select the logical operator AND or OR to add additional conditions. Specifying the opening and closing parentheses is optional. 

For more information about slot data types and event operators, see Slot-data-types.

Click Add selection criteria.pngto specify multiple classes in the selection criteria. You can specify a maximum of 5 event classes. The multiple class conditions in the selection criteria are separated by using the OR operator.

Scenario

Sarah is an administrator at Apex Global. She has to create a separate event policy for each class if she wants to use the same policy configuration across different event classes. Creating these policies is a tedious task because the event class count is huge. She can click Add selection criteria.pngin the event selection criteria to specify multiple classes, use the policy configurations across these classes in a single policy, and reduce the time that she used to spend creating separate policies for each class.

Click Preview to view existing events that match the event selection criteria. With event previewing, you can fine-tune the event selection criteria before a policy is applied to events. This way, you can process specific events based on your business requirement. The preview displays the event count of only existing events that are not closed. A maximum of five events are displayed in the preview and sorted according to the event modification time in descending order. You can preview events for multiple event selection criteria conditions. Usually, event policies process only incoming events that match the selection criteria.

Scenario

Sarah is an administrator at Apex Global. She wants to foresee events that are processed by the event policy before it is applied to events so that she can fine-tune the event selection criteria to process specific events based on her business requirement.

Can Sarah achieve this goal?

Yes! Sarah can click Preview for the event selection criteria field on the Create Event Policy screen to preview matching events.

Refer to the following example to view the event count and the event preview:

Matching events count.png

Event selection criteria preview.png

Important

  • You cannot directly specify an empty string in the selection criteria. However, you can specify an empty string by using regular expressions (regex) as follows:

    slotName Matches (^$|^.*@.*\\..*$)

    The following table shows the regular expression equivalent for a string::

  • If you specify multiple classes in the event selection criteria, you cannot use the following criteria as the only criteria to filter events:
    Criteria: Class Equals Event

Example criteria: If you specify the following criteria, all the ALARM events that contain "database" in the message and all the PATROL events that arrive from hosts that begin with "clm" and contain "database" in the message are selected and the policy is applied to them.

The green tick mark indicates that the event selection criteria syntax is correct.

Multiple class support in event selection criteria.png

For the slot value, you can specify global variables as shown in the following image:

Global_var_in_selection_criteria1.png

During execution of the policy, the global variable name is replaced with the variable value. For more information about global variables, see Information-sharing-between-enrichment-policies-with-global-variables.

You can also copy the criteria by clicking Copy Copy.png. The copied criteria can be reused in subsequent policies by pressing Ctrl+V in the Event Selection Criteria field.

About specifying the class

A condition based on the class slot must be specified before any other condition. In the subsequent conditions, the list of slots change based on the class specified. The subsequently displayed slots are subclasses of the parent class selected in the first condition.

For example, in the following image notice the list of slots specific to the selected Alarm class.

event selection criteria class.png

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*