<?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: DQL to filter problem events by alerting profile in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/DQL-to-filter-problem-events-by-alerting-profile/m-p/232770#M458</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/52176"&gt;@dneimke&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;| filter matchesValue(labels.alerting_profile,"&amp;lt;the AP you are looking for&amp;gt;")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Yos&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 24 Dec 2023 07:24:25 GMT</pubDate>
    <dc:creator>Yosi_Neuman</dc:creator>
    <dc:date>2023-12-24T07:24:25Z</dc:date>
    <item>
      <title>DQL to filter problem events by alerting profile</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-to-filter-problem-events-by-alerting-profile/m-p/232769#M457</link>
      <description>&lt;P&gt;I have a DQL query that returns a list of events for problem records which looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch events, from:now()-30d, to:now()  
| filter event.kind == "DAVIS_PROBLEM"
| filter contains(event.name, "database connection")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The query returns records as expected, but now I want to modify the query to filter for just a single alerting profile.&lt;/P&gt;&lt;P&gt;I can see the alerting profiles are coming through in a field/property named labels.alerting_profile&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-12-24 115728.png" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/16446i015C406F4EA211AA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-12-24 115728.png" alt="Screenshot 2023-12-24 115728.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;How can I add a filter to my DQL query so that it returns just the alerting_profile records I want?&lt;/P&gt;</description>
      <pubDate>Sun, 24 Dec 2023 03:17:33 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-to-filter-problem-events-by-alerting-profile/m-p/232769#M457</guid>
      <dc:creator>dneimke</dc:creator>
      <dc:date>2023-12-24T03:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: DQL to filter problem events by alerting profile</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-to-filter-problem-events-by-alerting-profile/m-p/232770#M458</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/52176"&gt;@dneimke&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;| filter matchesValue(labels.alerting_profile,"&amp;lt;the AP you are looking for&amp;gt;")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Yos&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Dec 2023 07:24:25 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-to-filter-problem-events-by-alerting-profile/m-p/232770#M458</guid>
      <dc:creator>Yosi_Neuman</dc:creator>
      <dc:date>2023-12-24T07:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: DQL to filter problem events by alerting profile</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-to-filter-problem-events-by-alerting-profile/m-p/232771#M459</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/6931"&gt;@Yosi_Neuman&lt;/a&gt;, that worked!&lt;BR /&gt;&lt;BR /&gt;As a follow up... do you know if it's possible to declare and use variables in grail queries? Similar to using &lt;A href="https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/letstatement" target="_self"&gt;the let statement in kusto queries&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;For example, something like this psuedo-code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;// declare a variable
let p = "my_alerting_profile_name"

fetch events, from:now()-30d, to:now()  
... omitted for brevity
| filter matchesValue(profile, $p)  // &amp;lt;-- use the variable here&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Note: I'm using these queries in a Notebook&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Dec 2023 08:15:20 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-to-filter-problem-events-by-alerting-profile/m-p/232771#M459</guid>
      <dc:creator>dneimke</dc:creator>
      <dc:date>2023-12-24T08:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: DQL to filter problem events by alerting profile</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-to-filter-problem-events-by-alerting-profile/m-p/232777#M460</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am not sure but maybe &lt;A title="this works" href="https://docs.dynatrace.com/docs/shortlink/dashboard-component-variable" target="_blank" rel="noopener"&gt;this works&lt;/A&gt; for you.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Sun, 24 Dec 2023 12:20:10 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-to-filter-problem-events-by-alerting-profile/m-p/232777#M460</guid>
      <dc:creator>AntonPineiro</dc:creator>
      <dc:date>2023-12-24T12:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: DQL to filter problem events by alerting profile</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-to-filter-problem-events-by-alerting-profile/m-p/232778#M461</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/52176"&gt;@dneimke&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ammm found &lt;A href="https://docs.dynatrace.com/docs/shortlink/dashboard-component-variable" target="_blank" rel="noopener"&gt;variables only for dashboards&lt;/A&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":face_with_rolling_eyes:"&gt;🙄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Don't know how to add variables to notebook &lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yos &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Dec 2023 12:24:56 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-to-filter-problem-events-by-alerting-profile/m-p/232778#M461</guid>
      <dc:creator>Yosi_Neuman</dc:creator>
      <dc:date>2023-12-24T12:24:56Z</dc:date>
    </item>
  </channel>
</rss>

