Event Analytics – Using Endpoints¶
Getting Top Events¶
The Event Analytics Service outputs the most frequent events with their number of occurrences. It receives the entire dataset as input, performs sorting based on the number of occurrences and returns a sorted list of events with the associated count.
Endpoint:
POST /findTopEvents
Content-Type: application/json
Request example:
{
"numberOfTopPositionsRequired": 2,
"eventsMetadata": {
"eventTextPropertyName": "string"
},
"events": [
{
"_time": "2017-11-21T12:23:07.961Z",
"string": "a",
"string_qc": 0
},
{
"_time": "2017-11-21T12:23:08.961Z",
"string": "x",
"string_qc": 0
},
{
"_time": "2017-11-21T12:23:08.961Z",
"string": "b",
"string_qc": 0
},
{
"_time": "2017-11-21T12:23:08.961Z",
"string": "h",
"string_qc": 0
},
{
"_time": "2017-11-21T12:23:09.961Z",
"string": "b",
"string_qc": 0
},
{
"_time": "2017-11-21T12:24:00.961Z",
"string": "b",
"string_qc": 0
},
{
"_time": "2017-11-21T12:25:03.961Z",
"string": "b",
"string_qc": 0
},
{
"_time": "2017-11-21T12:30:02.961Z",
"string": "k",
"string_qc": 0
},
{
"_time": "2017-11-21T12:33:08.961Z",
"string": "l",
"string_qc": 0
},
{
"_time": "2017-11-21T12:33:09.961Z",
"string": "b",
"string_qc": 0
},
{
"_time": "2017-11-21T12:34:08.961Z",
"string": "b",
"string_qc": 0
},
{
"_time": "2017-11-21T12:35:09.961Z",
"string": "b",
"string_qc": 0
},
{
"_time": "2017-11-21T12:36:00.961Z",
"string": "p",
"string_qc": 0
},
{
"_time": "2017-11-21T12:37:03.961Z",
"string": "p",
"string_qc": 0
},
{
"_time": "2017-11-21T12:38:28.961Z",
"string": "q",
"string_qc": 0
}
]
}
Response example:
[
{
"appearances": 7,
"string": "b"
},
{
"appearances": 2,
"string": "p"
}
]
Counting Events in a Time Range¶
Receives as input a list of events and a splitInterval
property in eventsMetadata (value in milliseconds). The output contains the time range and the number of event occurrences in that specific time range.
Endpoint:
POST /countEvents
Content-Type: application/json
Request example:
{
"eventsMetadata": {
"eventTextPropertyName": "text",
"splitInterval": 5000
},
"events": [
{
"_time": "2017-10-01T12:00:00.001Z",
"text": "INTRODUCING FUEL",
"text_qc": 0
},
{
"_time": "2017-10-01T12:00:00.023Z",
"text": "INTRODUCING FUEL",
"text_qc": 0
},
{
"_time": "2017-10-01T12:00:01.001Z",
"text": "Status@Flame On",
"text_qc": 0
},
{
"_time": "2017-10-01T12:00:02.001Z",
"text": "Status@Flame Off",
"text_qc": 0
},
{
"_time": "2017-10-01T12:00:03.001Z",
"text": "Error code: 340",
"text_qc": 0
},
{
"_time": "2017-10-01T12:00:04.001Z",
"text": "Error code: 340",
"text_qc": 0
},
{
"_time": "2017-10-01T12:00:04.002Z",
"text": "Error code: 340",
"text_qc": 0
},
{
"_time": "2017-10-01T12:00:05.001Z",
"text": "INTRODUCING FUEL",
"text_qc": 0
},
{
"_time": "2017-10-01T12:00:08.001Z",
"text": "Status@Flame On",
"text_qc": 0
},
{
"_time": "2017-10-01T12:00:09.001Z",
"text": "Status@Flame Off",
"text_qc": 0
}
]
}
Response example:
{
"output": [{
"startTime": "2017-10-01T12:00:00.001Z",
"endTime": "2017-10-01T12:00:05Z",
"eventCount": 7
},
{
"startTime": "2017-10-01T12:00:05.001Z",
"endTime": "2017-10-01T12:00:10Z",
"eventCount": 3
}]
}
Filtering Events¶
Receives as input a list of events and an ignore list (filterList
). The output contains those events from the received event list that are not part of the ignore list.
Endpoint:
POST /filterEvents
Content-Type: application/json
Request example:
{
"eventsMetadata": {
"eventTextPropertyName": "text"
},
"events": [
{
"_time": "2017-10-01T12:00:00.001Z",
"text": "INTRODUCING FUEL",
"text_qc": 0
},
{
"_time": "2017-10-01T12:00:01.001Z",
"text": "Status@Flame On",
"text_qc": 0
},
{
"_time": "2017-10-01T12:00:02.001Z",
"text": "Status@Flame Off",
"text_qc": 0
},
{
"_time": "2017-10-01T12:00:03.001Z",
"text": "Error code: 340",
"text_qc": 0
}
],
"filterList": [
"INTRODUCING FUEL",
"MEANINGLESS ALARM",
"Status@Flame On"
]
}
Response example:
{
"output": [
{
"_time": "2017-10-01T12:00:02.001Z",
"text_qc": 0,
"text": "Status@Flame Off"
},
{
"_time": "2017-10-01T12:00:03.001Z",
"text_qc": 0,
"text": "Error code: 340"
}
]
}
Removing Duplicate Events¶
The Event Analytics Service can remove consecutive identical events. It receives as input a list of events and a splitInterval
property in eventsMetadata
(value in milliseconds), which defines the maximum time between an event and its duplicate. The output equals the input, but duplicates are removed.
Endpoint:
POST /removeDuplicateEvents
Content-Type: application/json
Request example:
{
"eventsMetadata": {
"eventTextPropertyName": "text",
"splitInterval": 5000
},
"events": [
{
"_time": "2017-10-01T12:00:00.001Z",
"text": "INTRODUCING FUEL",
"text_qc": 0
},
{
"_time": "2017-10-01T12:00:01.001Z",
"text": "Status@Flame On",
"text_qc": 0
},
{
"_time": "2017-10-01T12:00:02.001Z",
"text": "Status@Flame Off",
"text_qc": 0
},
{
"_time": "2017-10-01T12:00:03.001Z",
"text": "Error code: 340",
"text_qc": 0
},
{
"_time": "2017-10-01T12:00:04.001Z",
"text": "Error code: 340",
"text_qc": 0
},
{
"_time": "2017-10-01T12:00:06.001Z",
"text": "INTRODUCING FUEL",
"text_qc": 0
},
{
"_time": "2017-10-01T12:00:08.001Z",
"text": "Status@Flame On",
"text_qc": 0
},
{
"_time": "2017-10-01T12:00:09.001Z",
"text": "Status@Flame Off",
"text_qc": 0
}
]
}
Response example:
{
"output": [
{
"_time": "2017-10-01T12:00:00.001Z",
"text_qc": 0,
"text": "INTRODUCING FUEL"
},
{
"_time": "2017-10-01T12:00:01.001Z",
"text_qc": 0,
"text": "Status@Flame On"
},
{
"_time": "2017-10-01T12:00:02.001Z",
"text_qc": 0,
"text": "Status@Flame Off"
},
{
"_time": "2017-10-01T12:00:03.001Z",
"text_qc": 0,
"text": "Error code: 340"
},
{
"_time": "2017-10-01T12:00:06.001Z",
"text_qc": 0,
"text": "INTRODUCING FUEL"
},
{
"_time": "2017-10-01T12:00:08.001Z",
"text_qc": 0,
"text": "Status@Flame On"
},
{
"_time": "2017-10-01T12:00:09.001Z",
"text_qc": 0,
"text": "Status@Flame Off"
}
]
}
Matching Patterns¶
Receives as input a numerical parameter maxPatternInterval
(value in milliseconds) and three lists: patternsList
, nonEvents
, eventsInput
. The output contains each pattern with corresponding matched events and the time window when these occur.
Endpoint:
POST /matchEventPatterns
Content-Type: application/json
Request example:
{
"maxPatternInterval": 200000,
"patternsList": [
{
"pattern": [
{
"eventText": "INTRODUCING FUEL",
"minRepetitions": 1,
"maxRepetitions": 2
},
{
"eventText": "Status@Flame On",
"minRepetitions": 0,
"maxRepetitions": 1
},
{
"eventText": "Module STOP due to parameter assignment",
"minRepetitions": 1,
"maxRepetitions": 1
}
]
},
{
"pattern": [
{
"eventText": "Downloading the module database causes module .. restart",
"minRepetitions": 1,
"maxRepetitions": 1
},
{
"eventText": "The SIMATIC mode was selected for time-of-day synchronization of the module with Id: ..",
"minRepetitions": 1,
"maxRepetitions": 1
}
]
}
],
"nonEvents": [
"Error 2.. occurred",
"STOPPING ENGINE"
],
"eventsInput": {
"eventsMetadata": {
"eventTextPropertyName": "text"
},
"events": [
{
"_time": "2017-10-01T12:00:00.001Z",
"text": "Downloading the module database causes module 11 restart",
"text_qc": 0
},
{
"_time": "2017-10-01T12:00:01.001Z",
"text": "The direction for forwarding the time of day is recognized automatically by the module",
"text_qc": 0
},
{
"_time": "2017-10-01T12:00:02.001Z",
"text": "Status@Flame On",
"text_qc": 0
},
{
"_time": "2017-10-01T12:00:03.001Z",
"text": "The SIMATIC mode was selected for time-of-day synchronization of the module with Id: 33",
"text_qc": 0
},
{
"_time": "2017-10-01T12:00:06.001Z",
"text": "INTRODUCING FUEL",
"text_qc": 0
},
{
"_time": "2017-10-01T12:00:09.001Z",
"text": "Module STOP due to parameter assignment",
"text_qc": 0
}
]
}
}
Response example:
{
"output": [
{
"patternIndex": 1,
"timeWindow": {
"startTimestamp": "2017-10-01T12:00:00.001Z",
"endTimestamp": "2017-10-01T12:00:03.001Z"
},
"matchedEvents": [
{
"_time": "2017-10-01T12:00:00.001Z",
"text_qc": 0,
"text": "Downloading the module database causes module 11 restart"
},
{
"_time": "2017-10-01T12:00:03.001Z",
"text_qc": 0,
"text": "The SIMATIC mode was selected for time-of-day synchronization of the module with Id: 33"
}
]
},
{
"patternIndex": 0,
"timeWindow": {
"startTimestamp": "2017-10-01T12:00:06.001Z",
"endTimestamp": "2017-10-01T12:00:09.001Z"
},
"matchedEvents": [
{
"_time": "2017-10-01T12:00:06.001Z",
"text_qc": 0,
"text": "INTRODUCING FUEL"
},
{
"_time": "2017-10-01T12:00:09.001Z",
"text_qc": 0,
"text": "Module STOP due to parameter assignment"
}
]
}
]
}
Any questions left?
Except where otherwise noted, content on this site is licensed under the Development License Agreement.