<?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 Re: Fetch active problems in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Fetch-active-problems/m-p/213791#M33</link>
    <description>&lt;P&gt;Hi Edu,&lt;/P&gt;
&lt;P&gt;One way of achieving this would be following&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;fetch all problems&lt;/LI&gt;
&lt;LI&gt;sort them by the timestamp&lt;/LI&gt;
&lt;LI&gt;summarize them by display_id and select the first status. because in the previous step the records are sorted by timestamp, you will get after the summarize the latest problem status&lt;/LI&gt;
&lt;LI&gt;then you just filter for active problems&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;And here you have the query&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;fetch events
| filter event.kind == "DAVIS_PROBLEM"
| sort timestamp desc
| summarize  affected_entities= first(affected_entity_ids),event.status=first(event.status), by:display_id
| filter event.status != "CLOSED"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also please have a look at following help page where there are further DQL davis examples:&amp;nbsp;&lt;A href="https://www.dynatrace.com/support/help/shortlink/davis-dql-examples" target="_blank"&gt;https://www.dynatrace.com/support/help/shortlink/davis-dql-examples&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;BR /&gt;Sini&lt;/P&gt;</description>
    <pubDate>Mon, 19 Jun 2023 09:09:27 GMT</pubDate>
    <dc:creator>sinisa_zubic</dc:creator>
    <dc:date>2023-06-19T09:09:27Z</dc:date>
    <item>
      <title>Fetch active problems</title>
      <link>https://community.dynatrace.com/t5/DQL/Fetch-active-problems/m-p/213775#M26</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I am trying to make a query that would fetch currently active problems, but I'm struggling with handling multiple of the same&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;display_id&lt;/CODE&gt;&lt;SPAN&gt;.&amp;nbsp;The filters I think will be good enough for me would look like this:&lt;BR /&gt;&lt;CODE class="c-mrkdwn__code" data-stringify-type="code"&gt;| filter event.kind == "DAVIS_PROBLEM" and event.status == "ACTIVE"&lt;/CODE&gt;. However, now I need a way to fetch only the latest update of a given problem (to my understanding, the same problem id multiple times means the problem got updated and I only want to consider the problem from the latest snapshot). Thanks in advance!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 06:51:42 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Fetch-active-problems/m-p/213775#M26</guid>
      <dc:creator>educampver</dc:creator>
      <dc:date>2023-06-01T06:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: Fetch active problems</title>
      <link>https://community.dynatrace.com/t5/DQL/Fetch-active-problems/m-p/213791#M33</link>
      <description>&lt;P&gt;Hi Edu,&lt;/P&gt;
&lt;P&gt;One way of achieving this would be following&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;fetch all problems&lt;/LI&gt;
&lt;LI&gt;sort them by the timestamp&lt;/LI&gt;
&lt;LI&gt;summarize them by display_id and select the first status. because in the previous step the records are sorted by timestamp, you will get after the summarize the latest problem status&lt;/LI&gt;
&lt;LI&gt;then you just filter for active problems&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;And here you have the query&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;fetch events
| filter event.kind == "DAVIS_PROBLEM"
| sort timestamp desc
| summarize  affected_entities= first(affected_entity_ids),event.status=first(event.status), by:display_id
| filter event.status != "CLOSED"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also please have a look at following help page where there are further DQL davis examples:&amp;nbsp;&lt;A href="https://www.dynatrace.com/support/help/shortlink/davis-dql-examples" target="_blank"&gt;https://www.dynatrace.com/support/help/shortlink/davis-dql-examples&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;BR /&gt;Sini&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2023 09:09:27 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Fetch-active-problems/m-p/213791#M33</guid>
      <dc:creator>sinisa_zubic</dc:creator>
      <dc:date>2023-06-19T09:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: Fetch active problems</title>
      <link>https://community.dynatrace.com/t5/DQL/Fetch-active-problems/m-p/236192#M611</link>
      <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/38283"&gt;@sinisa_zubic&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;We are using similar query to fetch the problems which are open for more than 15 days.&lt;/P&gt;&lt;P&gt;However, what we are observing is, it is not matching with the count on problem card page.&lt;/P&gt;&lt;P&gt;As per more information received from support, &lt;STRONG&gt;fetch events&lt;/STRONG&gt;&amp;nbsp;is fetching the events associated with problem not actual number of problem and problem may have multiple events.&lt;/P&gt;&lt;P&gt;Is it possible to get actual count of problem or if that is not possible, how can we modify above query to match it to actual problem number on problem card page?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;AK&lt;/P&gt;</description>
      <pubDate>Sat, 03 Feb 2024 15:47:08 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Fetch-active-problems/m-p/236192#M611</guid>
      <dc:creator>AK</dc:creator>
      <dc:date>2024-02-03T15:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: Fetch active problems</title>
      <link>https://community.dynatrace.com/t5/DQL/Fetch-active-problems/m-p/236193#M612</link>
      <description>&lt;P&gt;You should keep only those events where&amp;nbsp;&lt;STRONG&gt;display_id&amp;nbsp;&lt;/STRONG&gt;is not null.&amp;nbsp; As you notice if you don't do this, you will fetch all the events in the tenant.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;</description>
      <pubDate>Sat, 03 Feb 2024 21:52:38 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Fetch-active-problems/m-p/236193#M612</guid>
      <dc:creator>DantePaoloni</dc:creator>
      <dc:date>2024-02-03T21:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: Fetch active problems</title>
      <link>https://community.dynatrace.com/t5/DQL/Fetch-active-problems/m-p/236288#M614</link>
      <description>&lt;P&gt;Don't know the details of the conversation you had with support, but with adding&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| filter event.kind == "DAVIS_PROBLEM"
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;to the query, you filter only on problems and not the events related to the problems.&lt;/P&gt;
&lt;P&gt;My response from 1st June is already a bit outdated. Since then additional fields have been added to Grail (&lt;A href="https://docs.dynatrace.com/docs/shortlink/release-notes-saas-sprint-274#fixed-data-types-of-grail-fields-for-davis-event-and-davis-problem-events" target="_blank" rel="noopener"&gt;which are also documented in the release notes&lt;/A&gt;) and should also be in the query:&amp;nbsp;problem.dt.davis.is_duplicate,&amp;nbsp; problem.maintenance.is_under_maintenance .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;following query should give you a much more accurate result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;fetch events, from:now()-370m
| filter dt.system.bucket == "default_davis_events"
| filter event.kind == "DAVIS_PROBLEM"
| summarize {problem=takeMax(record(timestamp,resolved_problem_duration,dt.davis.is_duplicate,event.status,maintenance.is_under_maintenance,dt.davis.is_frequent_event, event.start)) }, by:{display_id}
| fieldsFlatten problem
| filter problem.event.status != "CLOSED"
| filter problem.dt.davis.is_duplicate == false and problem.maintenance.is_under_maintenance == false&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;And to filter on those events, which are longer open than 15 days just add to the query this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| filter problem.event.start &amp;lt; now() - 15d&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;BR /&gt;Sini&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 13:46:16 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Fetch-active-problems/m-p/236288#M614</guid>
      <dc:creator>sinisa_zubic</dc:creator>
      <dc:date>2024-02-05T13:46:16Z</dc:date>
    </item>
  </channel>
</rss>

