<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Detect OS Service Status Changes Using DQL Queries in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Detect-OS-Service-Status-Changes-Using-DQL-Queries/m-p/289314#M2746</link>
    <description>&lt;P&gt;Hello community,&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;Here is the query I have so far:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;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&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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?&lt;/P&gt;</description>
    <pubDate>Wed, 17 Dec 2025 12:39:22 GMT</pubDate>
    <dc:creator>Fer_henrique</dc:creator>
    <dc:date>2025-12-17T12:39:22Z</dc:date>
    <item>
      <title>Detect OS Service Status Changes Using DQL Queries</title>
      <link>https://community.dynatrace.com/t5/DQL/Detect-OS-Service-Status-Changes-Using-DQL-Queries/m-p/289314#M2746</link>
      <description>&lt;P&gt;Hello community,&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;Here is the query I have so far:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;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&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Dec 2025 12:39:22 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Detect-OS-Service-Status-Changes-Using-DQL-Queries/m-p/289314#M2746</guid>
      <dc:creator>Fer_henrique</dc:creator>
      <dc:date>2025-12-17T12:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: Detect OS Service status change in DQL</title>
      <link>https://community.dynatrace.com/t5/DQL/Detect-OS-Service-Status-Changes-Using-DQL-Queries/m-p/289342#M2747</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;The reliable way to capture a running → stopped transition in the last 30 minutes is to use events/problems for OS Services (raised when a service stops), filtered to the target host.&lt;BR /&gt;After that you can use this DQL:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch events
| filter timestamp &amp;gt;= now()-30m
| filter event.kind == "DAVIS_PROBLEM"
| filter contains(lower(event.title), "service")
| filter contains(lower(event.title), "stopped")
| expand svc = affectedEntities
| filter svc.entityType == "OS_SERVICE"
| expand h = affectedEntities
| filter h.entityType == "HOST" AND h.entityId == "HOST-99678FB7C13FBC95"
| fields svc.displayName, svc.entityId, event.start, event.end, event.status, event.title&lt;/LI-CODE&gt;&lt;P&gt;This returns OS services on HOST that stopped in the last 30 minutes — i.e., the actual running → stopped transitions.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Nov 2025 12:41:18 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Detect-OS-Service-Status-Changes-Using-DQL-Queries/m-p/289342#M2747</guid>
      <dc:creator>t_pawlak</dc:creator>
      <dc:date>2025-11-11T12:41:18Z</dc:date>
    </item>
  </channel>
</rss>

