Mapping Netcool/OMNIbus fields in Node-RED
You can see how the JSON formatted messages received from the Internet of Things are mapped to Necool/OMNIbus fields using the Node-RED GUI.
The EventFieldMap contains a list of Netcool OMNIbus fields and a text box that contains the value to which it will be set. The values are set as a key-value pair in the JavaScript object.
Within the GUI, the node is shown as a form with two columns:
- Column one contains the ObjectServer fields.
- Column two contains the values to be set for each
ObjectServer
field.For fields other than the
Severity
field, the value in Column two can be one of the following:- A fixed string.
- A variable specified in mustache format:
{{field1}}
where
field1
is the variable to which the field will be set when the probe sends the event to the ObjectServer. For the
Severity
field, map the field to an object within the msg.payload and apply conditions to set the final severity value. For details, seeConfiguring the Severity field.Note: If you use double quotes in column two, they must be properly escaped using the backslash character; otherwise it will break JSON format.
Adding mappings
You can add more, optional ObjectServer fields by using the Add button at the foot of the EventFieldMap node GUI.
Configuring the Severity field
If
you want to assign an element or token and apply further conditions
to the Severity
field to reflect the final severity
level to be set, you can do so by updating the value for the Severity
field in column 2. This gives better flexibility and node re-usability
in a flow without having to duplicate the Event Map node to support
different severity events.
The following example allows you to add a severity of Catastrophic:
Severity = field2
if == "catastrophic" set Severity = 5 (Critical)
if == "critical" set Severity = 5 (Critical)
if == "major" set Severity = 4 (Major)
if == "minor" set Severity = 2 (Minor)
else , set Severity = 1 (Clear)
The following example allows you to apply conditions to the integer values associated with the Severity field:
Severity = field2
if > "5" set Severity = 5 (Critical)
if > "3" set Severity = 4 (Major)
if > "2" set Severity = 2 (Minor)
else , set Severity = 1 (Clear)