Migrating the probe parser configuration to the JSON parser configuration file

To migrate the probe parser configuration from the probe properties file to the new JSON parser configuration file format, use the following steps:

  1. Check the current probe properties file to determine whether probe is configured to receive JSON or XML events. View the probe properties file and check the MessagePayload probe property in the properties file: $OMNIHOME/probes/<arch>/message_bus.props

    If the MessagePayload property is set to, or starts with, json, the probe is configured to consume JSON events. Proceed to step 2.

    If the MessagePayload property is set to xml, the probe is configured to consume XML events. Leave this value as it is and verify that the TransformerFileproperty is set to the XML transformer file path.
    Note: The remaining steps do not apply if the probe is configured to parse XML events.
  2. If the probe is configured to consume JSON events, the probe properties are mapped to the JSON configuration as shown in the following table:
    Table 1. Mapping of probe properties to JSON configuration attributes

    Probe property name

    JSON parser configuration attribute name

    MessagePayload

    messagePayload

    MessageHeader

    messageHeader

    JsonNestedPayload

    jsonNestedPayload

    JsonNestedHeader

    jsonNestedHeader

    MessageDepth

    messageDepth

    RecordData

    dataToRecord

    For example, if the probe is configured with the following properties:
    • MessagePayload: json.payload.body.value
    • MessageHeader: json
    • JsonNestedPayload: json.event.alarm
    • JsonNestedHeader: json.header
    • MessageDepth: 5
    • RecordData: first-raise-time,last-raise-time
    The JSON parser configuration file will be:
    {
      "eventSources": [
        {
          "endpoint": "/lab/notification/api",
          "name": "AllJsonEventSource",
          "type": "ANY",
          "config": {
            "dataToRecord": [
              "first-raise-time",
              "last-raise-time"
            ],
            "messagePayload": "json.payload.body.value",
            "messageHeader": "json",
            "jsonNestedPayload": "json.event.alarm",
            "jsonNestedHeader": "json.header",
            "messageDepth": 5
          }
        }
      ]
    }
    
  3. Edit the template JSON parser configuration file provided in $OMNIHOME/probes/<arch>/message_bus_parser_config.json and copy the above JSON configuration into the file.
    Note: The name attribute can be used to assign a name to the event source. If there is only one event source configured in the JSON configuration, the endpoint attribute will be ignored.
  4. In the message_bus.props properties file, set the TransformerFile property to the JSON parser configuration file used in step 3.
  5. Restart the probe and verify that the probe starts successfully and parses the JSON events correctly.