Configuring the JSON parser to parse different JSON structures
To configure multiple parser configurations, use the following steps:
- Create a parser configuration file (.json)
in $OMNIHOME/probes/<arch>/ParserConfig.json
A template is provided in $OMNIHOME/probes/<arch>/message_bus_parser_config.json. This template contains three parser configurations: notification, resynchronized alarm, and a common parser for any alarms that does not match the endpoint criteria of the other two parsers. This
OtherAlarmParser
is indicated by the configuration with endpoint= “ANY”
. - Update the
endpoint
attribute to be the same as the endpoint set by the transport used by the probe.For example, for the restWebSocket transport, the endpoints for alarms retrieved from resynchronization and notifications are the
resync
andwebSocketURI
transport property values respectively. - Update “
messagePayload
”, ”messageHeader
”,jsonNestedPayload
”, ”jsonNestedHeader
”, ”messageDepth
”, and ”dataToRecord
” to suit the alarm structure to be parsed. - Optionally, update the
OtherAlarmParser
configuration so that the parser traverses the JSON event and generates elements on the leaf nodes instead of flattening the JSON event. - In the probe properties file, set the TransfomerFile property
to the parser configuration file created in Step 1.
TransformerFile : ‘$OMNIHOME/probes/<arch>/ParserConfig.json’