Hello community,
I am building a DQL query based on OS Services to monitor processes on a host. My goal is to identify when, within a 30‑minute interval, a service changes its status from running to stopped.
Here is the query I have so far:
timeseries from:now() -30m, by:{`dt.entity.os:service`, dt.osservice.status, dt.entity.host}, count_availability = count(dt.osservice.availability)
| filter dt.entity.host == "HOST-99678FB7C13FBC95"
| lookup [ fetch `dt.entity.os:service` ], sourceField: `dt.entity.os:service`,
lookupField: id,
fields: { `Service Name` = entity.name }
| fieldsAdd current_status = if(dt.osservice.status == "stopped", "stopped", else:Null)
| fieldsAdd previous_status = if(isNotNull(current_status), "running", else:Null)
| fields `Service Name`, previous_status, current_status, dt.entity.host
Is there a way in DQL to create a condition that compares the current status with the previous status, so I can specifically detect the transition from running → stopped within this 30‑minute window?