This documentation supports an earlier version of BMC Helix Operations Management. Use the Product version picker to select and view the latest version of documentation.

Example: Check whether there is a time delay between events


Scenario

Sarah is an administrator at Apex Global. She wants to check whether there is a time delay between events. To achieve this goal, she wants to calculate the time difference between the event occurrence time and the current timestamp and use this time delay to enrich the event message by using an advanced enrichment policy.

To enrich the event message, perform the following steps:

  1. Define the event selection criteria.
  2. Build the policy workflow.

Actions used in the example

The following actions are used in the example:

  • Lookup
  • Variable
  • Enrich
  • If-Then-Else

For more information about actions, see Actions-for-advanced-and-time-based-enrichment.

To define the event selection criteria

  1. Select Configuration > Event Policies and click Create.
  2. In the Event Selection Criteria, define a condition to select events that contain the message "testTime".

The following image illustrates how the event selection criteria will look:

Event selection criteria Jan.png

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:

TipYou can hover over an action to view the complete label for the action as shown:Action_hover.png

  1. Add the Lookup action to search for a unique event. In the Lookup Settings, select With custom criteria.
    Lookup action Jan.png

  2. Add the Update incoming events action.

  3. Add the Variable action to retrieve the current timestamp by using the CurrentTimeStamp function and to store the function value in the $currentTime variable.
    Timestamp variable Jan.png

  4. Add the Variable action to calculate the time delay (For example, 5 minutes) from the current time and to store the result of the Math function as the variable value.
    Time difference Jan.png

  5. Add the If action to check if the time delay calculated in the previous step is more than the event occurrence time.
    If action Jan.png

  6. Under Then, add an Enrich action to enrich the detailed message in the event.
    Enrich then action Jan.png

  7. Under Else, add an Enrich action to enrich the detailed message in the event.
    Enrich else action Jan.png

Results

The resulting policy workflow checks if there is a time delay between events as shown in the following image:

Check if there is a time delay between events final policy workflow Jan.png

 

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