Administer > Policies > XML File Policies > XML File Policy User Interface > Configuring Mappings in XML File Policies

Configuring Mappings in XML File Policies

The Mappings page enables you to map XML elements and attributes to custom variables.

To access

  • In the Operations Connector user interface, click Create in the toolbar. Then click Event > XML XML File.

  • In the Operations Connector user interface, click Create in the toolbar. Then click Metric > XML XML File.

Click Mappings to open the policy Mappings page.

Mappings overview

A custom mapping definition consists of a map name (variable), an optional input data property (XML element or XML attribute), and one or more source and target value pairs. For example, you can assign the XML element Severity to the map name mapSeverity, and add a source value of serious. You can then assign the target value critical to the variable so that Operations Connector inserts the value critical into the event in all places where the variable is used.

XML properties use the following syntax: <$DATA:/<XMLProperty>>

<XMLProperty> is the path from the root XML element of XML data to a specific XML element or attribute within that data. XML path uses slashes (/) as the path delimiters.

For example, the custom definition with the mapSeverity map name has the input data property of <$DATA:/PerformanceAlert/Severity> where Severity is a child element of PerformanceAlert.

XML properties are optional. If you do not assign an input data property to a map name (variable), you must add the source value directly to the variable when you insert the variable in an event attribute.

The Sample Data tab is empty if no sample data has been loaded into the policy or if the sample data does not match any specified XML tags.

The Sample Data tab shows the following information if sample data is available:

  • XML Properties

    If sample data is available, the XML Properties section of the Sample Data tab shows all XML elements and attributes that match an XML tag.

    The XML Properties section by default shows the short path to the XML property or value. To view the full path, click Toggle Short/Full Path Notation. The full path begins with the XML tag specified in the Source tab.

    The items in the XML Properties section are by default sorted alphabetically in ascending order.

    To search for an XML property or value, type the search string in the Search Properties box. The list changes as you type; only matching items appear.

  • Values for <XMLProperty>

    This section displays the values of an XML property selected in the XML Properties section. If a value appears more than once, click Toggle Deduplication of XML Values to show or hide duplicate values. To find values that belong to more than one XML property, select the value and click Find Matching XML Events in Sample Data. The XML Sample Data window opens and shows all XML properties that have the selected value.

When you drag an XML element or an XML attribute from the XML properties list and drop it on the Default Value Mapping list, Operations Connector automatically adds the default prefix map to the map name and inserts the correct path to the XML property. You can then drag one or more XML source values from the XML values list and drop them on the Source Value list. You then finally only have to type the target values.

Tasks

How to configure XML mappings

This task describes how to map XML elements and attributes to custom variables.

  1. Create one or more custom variables.

    If you are working with sample data, drag the XML elements or attributes from the XML Properties list to the Map Name column. Operations Connector automatically adds the default prefix map to the map name and inserts the correct path to the XML property.

    Alternatively, click above the Map Name column and type the variable name in the map name field. XML properties are optional. If you do not assign an XML property to a variable, you must add the source value directly to the variable when you insert the variable in an event attribute.

  2. Add source and target value pairs to each custom variable.

    • If sample data is loaded in Operations Connector, drag a value from the Values for '...' list to the Source Value column, and then type the target value in the corresponding field.

      Alternatively, c Click above the Source Value column and type the source and target values in the corresponding fields.

    • Optional. In the Indicators tab, add indicators to the source or target value fields. After loading the indicators from the OMi server, the Indicators tab shows a hierarchy of configuration item types.

      To insert an indicator in a source or target value field, drag the indicator state (for example, HTTPServer:Normal) from the Indicators tab and drop it on the corresponding field.

    • Optional. In the Policy Variables tab, add policy variables to event or metric attributes. Operations Connector replaces the variables with the appropriate values in the generated event or metric.

      Use quotation marks to surround variables, for example "<$MSG_NODE>" or "<$MSG_GEN_NODE>", at least for those variables whose values can contain space characters.

Related tasks

UI Descriptions

Default Value Mappings

UI Element Description
Create new mapping definition. Adds a new mapping definition to the list of mappings.
Delete mapping definition. Deletes the selected mapping definition.
Copy Mapping Definition. Creates a copy of the selected mapping definition.
Move Up. Moves the selected mapping definition up to a higher position.
Move Down. Moves the selected mapping definition down to a lower position.
Map Name Name of the custom variable. Operations Connector automatically adds the default prefix map to the map name if the variable has been created from sample data.
Input Data Property

XML element or attribute assigned to the custom variable.

XML properties use the following syntax: <$DATA:/<XMLProperty>>

<XMLProperty> is the path from the root XML element of XML data to a specific XML element or attribute within that data. XML path uses slashes (/) as the path delimiters.

Operations Connector replaces the XML property at runtime with the value of the specified XML element or attribute. If you insert an XML value, the value will be used.

Data key assigned to the custom variable.

Perl attribute key names use the following syntax:

<$DATA:<AttributeName>>

where <AttributeName> is the data key name in a Perl hash array.

Operations Connector replaces the attribute name at runtime with the value of the specified key.

Create new mapping. Adds a new pair of source and target values to the mapping definition.
Delete mapping. Deletes the selected source and target value pair.
Copy Value Mapping. Creates a copy of the selected value mapping.
Move Up. Moves the selected value mapping up to a higher position.
Move Down. Moves the selected value mapping down to a lower position.
Source Value

Original value of the XML element or attribute.

Original value of the input data reference.

Target Value

New value of the XML element or attribute.

New value of the input data reference.

Sample Data Tab

UI Element Description
<Search Properties>

Entered search string is used to find an XML property or value. The list changes as you type; only matching items appear.

To clear the search results, click .

XML Properties

Shows all XML elements and attributes that match an XML tag.

The XML properties list is empty if no sample data has been loaded into the policy or if the sample data does not match any specified XML tags.

Toggle Short/Full Path Notation. Shows or hides the full path to the XML property or value. The full path begins with the XML tag specified in the Source tab. The XML Properties section by default shows the short path to the XML property or value.
Values for '...'

Displays the values of the XML property selected in the XML Properties section.

Find Matching Records. To find values that belong to more than one XML property, select the value and click Find Matching XML Events in Sample Data. The XML Sample Data window opens and shows all XML properties that have the selected value.
Toggle Deduplication. Shows or hides duplicate values.

Indicators Tab

UI Element

Description

Refresh. Loads the configured indicators from the connected OMi server.

  • Loading indicators from the OMi server may take a few seconds.

  • The Operations Connector server must be configured as an Operations Connector integration server in OMi for the indicators to load successfully.

<Search …>

Entered search string is used to search the indicators and highlight only the indicators containing the specified string.

To search for indicators with specific text strings in the name, type the string in the <Search …> field and click the button. The first matching indicator is selected in the list of rules. Click the and buttons to move to the previous and next matching indicator.

<Indicators>

Hierarchy of configuration item types with associated health indicators (HIs), which are applicable for the event integration only, and event type indicators (ETIs). To insert an indicator with a state in a policy, drag and drop the indicator from the Indicators tab to the relevant field in the policy.

Policy VariablesTab

Policy Variables Tab for Database and REST Web Service Listener Policies (Events only)

Variable Description
<$MSG_NODE> Returns the IP address of the node on which the original event took place. Sample output: 192.168.1.123
<$MSG_NODE_NAME> Returns the name of the node on which the original event took place. This is the hostname that the agent resolves for the node. This variable is not fixed, however, and can be changed by a policy on a per-event basis.
<$MSG_TEXT> Returns the full text of the event. For open message interface policies, this value is the msg_text parameter submitted by the opcmsg command. For the Windows Event Log this value is the event ID and description. Sample output: SU 03/19 16:13 + ttyp7 bill-root
<$MSG_TYPE> Delivers the name set for message type.

Policy Variables Tab for XML File and Structured Log File Policies (Events only)

Variable Description
<$MSG_NODE> Returns the IP address of the node on which the original event took place. Sample output: 192.168.1.123
<$MSG_NODE_NAME> Returns the name of the node on which the original event took place. This is the hostname that the agent resolves for the node. This variable is not fixed, however, and can be changed by a policy on a per-event basis.
<$MSG_TYPE> Delivers the name set for message type.

Policy Variables Tab for Open Message Interface, Scheduled Task, and SNMP Interceptor Policies (Events only)

Variable Description
<$MSG_NODE> Returns the IP address of the node on which the original event took place. Sample output: 192.168.1.123
<$MSG_NODE_NAME> Returns the name of the node on which the original event took place. This is the hostname that the agent resolves for the node. This variable is not fixed, however, and can be changed by a policy on a per-event basis.
<$MSG_TEXT> Returns the full text of the event. For open message interface policies, this value is the msg_text parameter submitted by the opcmsg command. For the Windows Event Log this value is the event ID and description. Sample output: SU 03/19 16:13 + ttyp7 bill-root
<$MSG_TYPE> Delivers the name set for message type.
<$NAME> (Scheduled Task Only) Returns the name of the policy that sent the event. Sample output: cpu_util
<$OPTION(N)> (Open Message Interface Only) Returns the value of an optional variable that is set by opcmsgor opcmon (for example, <$OPTION(A)>, < $OPTION(B)>, and so on.).
<$PROG> (Scheduled Task Only) Returns the name of the program executed by the scheduled task policy Sample output: check_for_upgrade.bat
<$USER> (Scheduled Task Only) Returns the name of the user under which the scheduled task was executed. Sample output: administrator

Policy Variables Tab for All Policy Types (Metrics only)

Variable Description
<$MSG_GEN_NODE>

Returns the IP address of the node that sends the event. Sample output: 192.168.1.123.

<$MSG_GEN_NODE_NAME> Returns the host name of the node that sends the event. Sample output: node123.example.com.