SentinelEvents lists the events raised by Sentinel monitors, such as a well below its minimum tubing head pressure, a compressor trip or a high tank level. Use it for event lists, alarm-load reports and bad-actor analysis on Explorer pages.
Fields
SentinelEvents is a database-backed object, so filtering and grouping run in SQL over every event, and the OI query functions are available.
| Field | Notes |
|---|---|
| EventId | The event's ID in Sentinel (the key) |
| MonitorName | The monitor that raised the event |
| TestName | The test within the monitor |
| SeverityName | How serious it is |
| BaseEntity, Entity, Asset | The equipment involved. Asset is a separate field from Entity. |
| StartTime, EndTime | When the event started and cleared. A null EndTime means it's still active. |
| Value | The reading that triggered the event, as text |
| State | |
| IsCurrent, IsDefault, Invalid | Flags. Invalid can be empty, and Invalid eq false doesn't match an empty value. |
Event lists
Active events on a chosen asset:
SentinelEvents?$filter=Entity eq ODataParam(asset,string) and IsCurrent eq true&$select=MonitorName,TestName,SeverityName,StartTime,Value&$orderby=StartTime desc
Open events for the morning meeting:
SentinelEvents?$filter=IsCurrent eq true and EndTime eq null&$select=Entity,MonitorName,SeverityName,StartTime,Value&$orderby=SeverityName,StartTime
Events in a chosen period:
SentinelEvents?$filter=StartTime ge ODataParam(startTime,datetime) and StartTime le ODataParam(endTime,datetime)&$select=Entity,MonitorName,TestName,SeverityName,StartTime,EndTime,Value&$orderby=StartTime desc&$top=1000
Events for one monitor, with an optional test filter (an empty test matches every test):
SentinelEvents?$filter=StartTime ge OI.daysago(7) and MonitorName eq ODataParam(monitor,string) and contains(TestName,ODataParam(test,string))&$select=Entity,TestName,StartTime,Value&$orderby=StartTime desc
One event:
SentinelEvents?$filter=EventId eq ODataParam(eventId,integer)
Event counts and trends
Events in the last week, by monitor and severity:
SentinelEvents?$apply=filter(StartTime ge OI.daysago(7))/groupby((MonitorName,SeverityName),aggregate($count as Events,StartTime with max as Latest))&$orderby=Events desc
Bad actors: the 20 assets with the most events this month:
SentinelEvents?$apply=filter(StartTime ge OI.startofmonth(now()))/groupby((Entity),aggregate($count as Events,TestName with countdistinct as Tests))&$orderby=Events desc&$top=20
Events per week, for a trend chart:
SentinelEvents?$apply=filter(StartTime ge OI.monthsago(6))/compute(OI.startofweek(StartTime) as Week)/groupby((Week),aggregate($count as Events))&$orderby=Week
Events by weekday and local hour, for an alarm-load heat map. OI.weekday returns 1 for Monday to 7 for Sunday:
SentinelEvents?$apply=filter(StartTime ge OI.monthsago(3))/compute(OI.weekday(OI.attimezone(StartTime,'Australia/Perth')) as Day,hour(OI.attimezone(StartTime,'Australia/Perth')) as Hour)/groupby((Day,Hour),aggregate($count as Events))&$orderby=Day,Hour
Durations
How long each event lasted. Events that are still open count up to now:
SentinelEvents?$filter=StartTime ge OI.daysago(7)&$compute=OI.minutesbetween(StartTime,OI.ifnull(EndTime,now())) as Minutes&$select=Entity,TestName,StartTime,EndTime,Minutes&$orderby=Minutes desc&$top=100
Average and longest duration per test, for cleared events:
SentinelEvents?$apply=filter(StartTime ge OI.monthsago(1) and EndTime ne null)/compute(OI.minutesbetween(StartTime,EndTime) as Minutes)/groupby((TestName),aggregate($count as Events,Minutes with average as AvgMinutes,Minutes with max as MaxMinutes))&$orderby=AvgMinutes desc
Readings above a threshold. Value is text, so convert it with OI.tonumber:
SentinelEvents?$filter=StartTime ge OI.daysago(7) and OI.tonumber(Value) gt 40&$select=Asset,TestName,Value,StartTime
Things to know
- Value is text. Use OI.tonumber(Value) to compare or average it. Values that aren't numbers become null.
- Always use a time window. Sentinel can hold a large history. Filter on StartTime so datasets stay under the 1,000-row limit.
- Use EndTime eq null for active events, or IsCurrent eq true for the current event of each test.
- Every signed-in user sees every event. Sentinel events aren't filtered by access rights.
- Look up one event by its key, SentinelEvents(884213), or with $filter=EventId eq 884213.
- Combine Sentinel with other objects using Union. SentinelEvents can be a branch.