Configuring the JSON parser to parse different JSON structures

To configure multiple parser configurations, use the following steps:

  1. 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”.

  2. 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 and webSocketURI transport property values respectively.

  3. Update “messagePayload”, ”messageHeader”, jsonNestedPayload”, ”jsonNestedHeader”, ”messageDepth”, and ”dataToRecord” to suit the alarm structure to be parsed.
  4. 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.
  5. In the probe properties file, set the TransfomerFile property to the parser configuration file created in Step 1.

    TransformerFile : ‘$OMNIHOME/probes/<arch>/ParserConfig.json’