Format operations begin with a <Format> property. Format operations can define information in events received from event sources using a new property and adhering to a specified format.
This property has the following format:
<Format> <Field conditional= input= format= output= /> </Format>
(Optional) References an event property whose existence or non-existence determines whether the format operation is performed.
Defines an event input property or list of event properties to be output in another property with a new format.
Defines the format for the specified input properties. Use substitution markers to indicate each property according to the order in the input attribute.
Defines a single output property that is assigned the value of the reformatted input properties.
Example: Format severity event input into a meaningful description
The following example searches for events that indicate a severity change for a resource and reformats this information into a short description:
<Format>
<Field input="resource,hostwork,severity" format="The {0} on machine {1} is
{2}" output="description" />
</Format>
The <Format> property searches for the resource, hostwork, and severity properties that indicates a change in severity for a resource on a host system. The property reformats the input values into a short description and outputs the description to the description property. The format attribute uses substitution markers according to the input properties order in the input attribute to put the property values correctly in the description. An example output description property looks similar to the following:
The CPU on machine server01 is Critical
Example: Format an assigned property with conditional criteria
The following example assigns the property referenced by township to the output property, but only if township exists. If township does not exist, the property referenced by city is assigned.
<Format>
<Field conditional=’township’ input=’township’ format="{0}}" output="municipality" />
<Field conditional=’!township’ input=’city’ format="{0}}" output="municipality" />
</Format>
|
Copyright © 2013 CA.
All rights reserved.
|
|