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: Retrieve the timestamp as a date format


Scenario

Sarah is an administrator at Apex Global. She wants to perform event diagnosis and track event logging. To achieve this goal, she wants to retrieve the current time in the MM/dd/YYYY format (for example) and enrich the message slot of the event with the retrieved timestamp value 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:

  • Variable
  • Enrich

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 from the class EVENT that contain the message "testTime".

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

Formatted timestamp event selection criteria.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:
Failed to execute the [excerpt-include] macro. Cause: [Error number 2 in 0: No wiki with id [confluencePage:page] could be found]. Click on this message for details.

  1. Add the Variable action to retrieve the current timestamp in the specified date format and to store the result of the CurrentFormattedTimeStamp function as the variable value.
    Formatted timestamp variable action.png

  2. Add an Enrich action to enrich the message with the formatted timestamp.
    Formatted timestamp enrich action.png

Results

The resulting policy workflow retrieves the timestamp as a date format as shown in the following image:

Retrieve the timestamp as a date format final policy workflow.png

 

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