Example configuration

Given the following JSON alarms received by the probe transport using notification and resynchronization respectively, the parser can be configured to parse both alarm structures.

Sample Notification Structure

{
  "payload": {
    "id": 1,
    "body": {
      "value": "{\"header\":{\"timestamp\":\"2017-07-
06T09:07:56Z\",\"event\":{\"alarm\":{\"id\":\"1234567\",\"resource\":\"4\",\"node-
id\":\"node01\",\"condition-type\":\"Link Down\",\"condition-
severity\":\"WARNING\",\"condition-source\":\"NETWORK\",\"condition-
state\":\"ACTIVE\",\"additional-text\":\"Link Down\",\"first-raise-time\":\"2000-01-
01T00:00:58.000+0000\",\"last-raise-time\":\"2000-01-01T00:00:58.000+0000\",\"number-
of-occurrences\":1,\"acknowledge-state\":\"ACKNOWLEDGED\",\"acknowledge-update-
time\":\"2017-07-06T09:07:56.463+0000\",\"additional-attrs\":{\"source\":\"EMS-
1\"}},\"_type\":\"alarmAcknowledged\"}}",
      "attributes": 1
    }
  },
  "event": "sample_alarm”
}

Sample resynchronized alarm structure

{
  "data": [
    {
      "id": "1222383102379613532",
      "type": "FilteredAlarm",
      "attributes": {
        "id": "1234567",
        "node-id": "node01",
        "state": "ACTIVE",
        "resource": "SWITCH",
        "condition-severity": "CRITICAL",
        "first-raise-time": "2017-07-06T13:43:19.000+0000",
        "last-raise-time": "2017-07-06T13:43:19.000+0000",
        "number-of-occurrences": 1,
        "acknowledge-state": "NOT_ACKNOWLEDGED"
      }
    },
    {
      "id": "-4067638085156070319",
      "type": "FilteredAlarm",
      "attributes": {
        "id": "7654321",
        "node-id": "node02",
        "state": "ACTIVE",
        "resource": "SWITCH",
        "condition-severity": "CRITICAL",
        "first-raise-time": "2017-07-06T13:42:59.000+0000",
        "last-raise-time": "2017-07-06T13:42:59.000+0000",
        "number-of-occurrences": 1,
        "acknowledge-state": "NOT_ACKNOWLEDGED"
      }
    }
  ]
}

The configuration to parse the above alarms and generate elements from the alarms (italics) as shown below.

Note: The endpoint is configured to the correct source.
{
  "eventSources": [
    {
      "endpoint": "/lab/notification/api",
      "name": "NotificationAlarmParser",
      "config": {
        "dataToRecord": [],
        "messagePayload": "json.payload.body.value",
        "messageHeader": "json",
        "jsonNestedPayload": "json.event.alarm",
        "jsonNestedHeader": "json.header",
        "messageDepth": 5
       } 
     },
     {
      "endpoint": “resync",
      "name": ”ResynchAlarmParser",
      "config": {
        "dataToRecord": [],
        "messagePayload": "json.payload.body.value",
        "messageHeader": "json",
        "jsonNestedPayload": "json.event.alarm",
        "jsonNestedHeader": "json.header",
        "messageDepth": 5
      }
 }]
}

The parser will generate the following elements for rules files consumption.

acknowledge-state=ACKNOWLEDGED
acknowledge-update-time=2017-07-06T09:07:56.463+0000
additional-attrs.source=EMS-1
additional-text=Link Down
condition-severity=WARNING
condition-source=NETWORK
condition-state=ACTIVE
condition-type=Link Down
first-raise-time=2000-01-01T00:00:58.000+0000
id=1234567
last-raise-time=2000-01-01T00:00:58.000+0000
node-id=node01
number-of-occurrences=1
resource=4
resync_event=false
timestamp=2017-07-06T09:07:56Z