<?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 Davis alert for interface count changes per device (7-day comparison) in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Davis-alert-for-interface-count-changes-per-device-7-day/m-p/288547#M2700</link>
    <description>&lt;P&gt;Hi everyone,&lt;BR /&gt;I’d like to create a Davis anomaly detection (DQL event) that triggers when the number of interfaces (ports) on a network device changes between two time periods (e.g., previous 7 days vs current 7 days).&lt;/P&gt;
&lt;P&gt;My initial attempts used a traffic/discards metric and rolling sums, but that’s not ideal when I only need to know how many interfaces exist (or report data) in each period. I think the right approach is to count distinct interfaces per device per period and compare.&lt;/P&gt;
&lt;P&gt;Does the DQL below look correct? Is there a simpler/better way?&lt;/P&gt;
&lt;P&gt;Goal&lt;/P&gt;
&lt;P&gt;Count distinct interfaces per device for last week and this week&lt;/P&gt;
&lt;P&gt;Join the two results&lt;/P&gt;
&lt;P&gt;Calculate the difference&lt;/P&gt;
&lt;P&gt;Trigger a Davis event if the count changed (non-zero difference)&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;timeseries sum(`com.dynatrace.extension.palo-alto.generic.if.in.discards.count`, default: 0),&lt;BR /&gt;by: { `dt.entity.network:interface`, `dt.entity.network:device` },&lt;BR /&gt;from: now() - 14d, to: now() -7d, interval: 1m&lt;BR /&gt;| fieldsAdd prev_roll = arrayMovingSum(`sum(\`com.dynatrace.extension.palo-alto.generic.if.in.discards.count\`, default:0)`, windowsize: 60)&lt;BR /&gt;| fieldsAdd aligned_key = toTimestamp(toLong(timeframe[start]) + 604800000.0)&lt;BR /&gt;// | fieldsKeep `dt.entity.network:interface`, `dt.entity.network:device`, aligned_key, prev_roll&lt;/P&gt;
&lt;P&gt;| join [&lt;BR /&gt;timeseries sum(`com.dynatrace.extension.palo-alto.generic.if.in.discards.count`, default: 0),&lt;BR /&gt;by: { `dt.entity.network:interface`, `dt.entity.network:device` },&lt;BR /&gt;from: now() - 7d, to: now(), interval: 1m&lt;BR /&gt;| fieldsAdd curr_roll = arrayMovingSum(`sum(\`com.dynatrace.extension.palo-alto.generic.if.in.discards.count\`, default:0)`, windowsize: 60)&lt;/P&gt;
&lt;P&gt;| fieldsAdd aligned_key = timeframe[start]&lt;BR /&gt;| fieldsKeep `dt.entity.network:interface`, `dt.entity.network:device`, aligned_key, curr_roll&lt;BR /&gt;], on: { `dt.entity.network:interface`, `dt.entity.network:device`,aligned_key}&lt;/P&gt;</description>
    <pubDate>Wed, 17 Dec 2025 10:05:13 GMT</pubDate>
    <dc:creator>RaidanAlmaqtari</dc:creator>
    <dc:date>2025-12-17T10:05:13Z</dc:date>
    <item>
      <title>Davis alert for interface count changes per device (7-day comparison)</title>
      <link>https://community.dynatrace.com/t5/DQL/Davis-alert-for-interface-count-changes-per-device-7-day/m-p/288547#M2700</link>
      <description>&lt;P&gt;Hi everyone,&lt;BR /&gt;I’d like to create a Davis anomaly detection (DQL event) that triggers when the number of interfaces (ports) on a network device changes between two time periods (e.g., previous 7 days vs current 7 days).&lt;/P&gt;
&lt;P&gt;My initial attempts used a traffic/discards metric and rolling sums, but that’s not ideal when I only need to know how many interfaces exist (or report data) in each period. I think the right approach is to count distinct interfaces per device per period and compare.&lt;/P&gt;
&lt;P&gt;Does the DQL below look correct? Is there a simpler/better way?&lt;/P&gt;
&lt;P&gt;Goal&lt;/P&gt;
&lt;P&gt;Count distinct interfaces per device for last week and this week&lt;/P&gt;
&lt;P&gt;Join the two results&lt;/P&gt;
&lt;P&gt;Calculate the difference&lt;/P&gt;
&lt;P&gt;Trigger a Davis event if the count changed (non-zero difference)&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;timeseries sum(`com.dynatrace.extension.palo-alto.generic.if.in.discards.count`, default: 0),&lt;BR /&gt;by: { `dt.entity.network:interface`, `dt.entity.network:device` },&lt;BR /&gt;from: now() - 14d, to: now() -7d, interval: 1m&lt;BR /&gt;| fieldsAdd prev_roll = arrayMovingSum(`sum(\`com.dynatrace.extension.palo-alto.generic.if.in.discards.count\`, default:0)`, windowsize: 60)&lt;BR /&gt;| fieldsAdd aligned_key = toTimestamp(toLong(timeframe[start]) + 604800000.0)&lt;BR /&gt;// | fieldsKeep `dt.entity.network:interface`, `dt.entity.network:device`, aligned_key, prev_roll&lt;/P&gt;
&lt;P&gt;| join [&lt;BR /&gt;timeseries sum(`com.dynatrace.extension.palo-alto.generic.if.in.discards.count`, default: 0),&lt;BR /&gt;by: { `dt.entity.network:interface`, `dt.entity.network:device` },&lt;BR /&gt;from: now() - 7d, to: now(), interval: 1m&lt;BR /&gt;| fieldsAdd curr_roll = arrayMovingSum(`sum(\`com.dynatrace.extension.palo-alto.generic.if.in.discards.count\`, default:0)`, windowsize: 60)&lt;/P&gt;
&lt;P&gt;| fieldsAdd aligned_key = timeframe[start]&lt;BR /&gt;| fieldsKeep `dt.entity.network:interface`, `dt.entity.network:device`, aligned_key, curr_roll&lt;BR /&gt;], on: { `dt.entity.network:interface`, `dt.entity.network:device`,aligned_key}&lt;/P&gt;</description>
      <pubDate>Wed, 17 Dec 2025 10:05:13 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Davis-alert-for-interface-count-changes-per-device-7-day/m-p/288547#M2700</guid>
      <dc:creator>RaidanAlmaqtari</dc:creator>
      <dc:date>2025-12-17T10:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: Davis alert for interface count changes per device (7-day comparison)</title>
      <link>https://community.dynatrace.com/t5/DQL/Davis-alert-for-interface-count-changes-per-device-7-day/m-p/291658#M2884</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/95545"&gt;@RaidanAlmaqtari&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;SPAN&gt;I just wanted to check in and see if you still need help with this. If so, I’d be happy to look into it for you!&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Please let me know what works best for you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Dec 2025 10:04:29 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Davis-alert-for-interface-count-changes-per-device-7-day/m-p/291658#M2884</guid>
      <dc:creator>IzabelaRokita</dc:creator>
      <dc:date>2025-12-17T10:04:29Z</dc:date>
    </item>
  </channel>
</rss>

