So if you just want to narrow down on the IncidentIds that this occurred on, I thing doing a stats aggregation would be more efficient. Something like this. <base_search>
| fields + _time, Incid...
See more...
So if you just want to narrow down on the IncidentIds that this occurred on, I thing doing a stats aggregation would be more efficient. Something like this. <base_search>
| fields + _time, IncidentId, Description, Status, Severity
| sort 0 +_time
| stats
values(Description) as Description,
latest(Status) as Status,
dc(Severity) as dc_severity,
list(Severity) as Sequence_Severity,
earliest(Severity) as Old_Severity,
latest(Severity) as New_Severity
by IncidentId
| where 'dc_severity'>1
| fields - dc_severity If you want to retain all of the original events apart of any IncidentId that this occurred on then you could use some sort of combo of streamstats and eventstats (less efficient but more detailed) <base_search>
| fields + _time, IncidentId, Description, Status, Severity
| sort 0 +IncidentId, -_time
| streamstats window=2
earliest(Severity) as Old_Severity,
latest(Severity) as New_Severity
by IncidentId
| eventstats
max(eval(if(NOT 'Old_Severity'=='New_Severity', 1, 0))) as status_change
by IncidentId
| where 'status_change'>0
| fields - status_change