Example: Enrich events according to the event hostname and event message
Before you begin, make sure that you:
- Create the global variable by using APIs.
- (Optional) Verify the global variable that you created in the previous step by using APIs.
For more information, see Global-variable-management-endpoints-in-the-REST-API.
To enrich the event owner and detailed message, perform the following steps:
Actions used in the example
- If
- Enrich
For more information about actions, see Actions for advanced and time-based enrichment.
To define the event selection criteria
- Select Configuration > Event Policies and click Create.
- In the Event Selection Criteria, define a condition to select events from the class NAGIOS_EV.
The following image illustrates how the event selection criteria will look:
To learn how to construct the event selection criteria, see Creating and enabling event policies.
To build the policy workflow
On the Advanced Enrichment page, perform the following steps to build the policy workflow:
Failed to execute the [excerpt-include] macro.
- Add the If action to confirm whether the host name contains "nagios-router" and the message contains "Downtime" in the event.
In the Then part, add the Enrich action to enrich the event owner with the value of the technical contact representative present in the $GV.nagios_contact global variable.
Assume that the $GV.nagios_contact global variable has the following attributes:- Add the If action to confirm whether the owner is the contact name present in the global variable $GV.nagios_contact.
- In the Then part, add the Enrich action to enrich the detailed Message with the contact information of the support representative.
Results
The policy workflow enriches the event owner and the detailed message as shown in the following image: