<?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: Is this a bug? Why does matchesPhrase fail and at the same time contains works? in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Is-this-a-bug-Why-does-matchesPhrase-fail-and-at-the-same-time/m-p/225105#M286</link>
    <description>&lt;P&gt;If there was a dot or a common I'd see it. Added a &lt;STRONG&gt;==&lt;/STRONG&gt; to make the problem even more clear. Note that "restarting" obviously starts and ends with a word character, and before and after it are non-word characters, so it meets the criteria for matchesPhrase. I'll be doing training with some people at my company and at this point I will be recommending they use contains and not matchesPhrase.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// this finds data:&lt;/P&gt;&lt;P&gt;fetch events&lt;BR /&gt;| filter event.status != "CLOSED" and matchesPhrase(dt.kubernetes.event.message, "restarting") and &lt;STRONG&gt;contains&lt;/STRONG&gt;(event.name, "restarting")&lt;/P&gt;&lt;P&gt;| filter dt.kubernetes.event.message == event.name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// this does not find data (unless wildcards are added):&lt;/P&gt;&lt;P&gt;fetch events&amp;nbsp;&lt;BR /&gt;| filter event.status != "CLOSED" and matchesPhrase(dt.kubernetes.event.message, "restarting") and &lt;STRONG&gt;matchesPhrase&lt;/STRONG&gt;(event.name, "restarting")&lt;/P&gt;&lt;P&gt;| filter dt.kubernetes.event.message == event.name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can run the above queries using the demo site and get the same responses.&amp;nbsp;This is what the actual data looks like:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;timestamp&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;10/11/2023, 8:03:28 AM&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;event.name&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Back-off restarting failed&amp;nbsp; container&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;event.status&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;ACTIVE&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;dt.kubernetes.event.message&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Back-off restarting failed container&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Oct 2023 15:11:41 GMT</pubDate>
    <dc:creator>GerrysR6</dc:creator>
    <dc:date>2023-10-11T15:11:41Z</dc:date>
    <item>
      <title>Is this a bug? Why does matchesPhrase fail and at the same time contains works?</title>
      <link>https://community.dynatrace.com/t5/DQL/Is-this-a-bug-Why-does-matchesPhrase-fail-and-at-the-same-time/m-p/225005#M281</link>
      <description>&lt;P&gt;Below is my query, which finds results. Note that both dt.kubernetes.event.message and event.name have the same value, which is "Back-off restarting failed container"&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;fetch events&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| filter event.status != "CLOSED" and matchesPhrase(dt.kubernetes.event.message, "restarting") and contains(event.name, "restarting")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| fields timestamp, event.name, event.status, dt.kubernetes.event.message&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| limit 1000&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;If I change contains to matchesPhrase there are no results. Why not? If I use&amp;nbsp;matchesPhrase(event.name, "*restarting*") there are results, why do I have to use a wildcard for event.name but not for dt.kubernetes.event.message?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2023 17:37:24 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Is-this-a-bug-Why-does-matchesPhrase-fail-and-at-the-same-time/m-p/225005#M281</guid>
      <dc:creator>GerrysR6</dc:creator>
      <dc:date>2023-10-10T17:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: Is this a bug? Why does matchesPhrase fail and at the same time contains works?</title>
      <link>https://community.dynatrace.com/t5/DQL/Is-this-a-bug-Why-does-matchesPhrase-fail-and-at-the-same-time/m-p/225062#M284</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;Maybe in the event.name field, there is a non-word character succeeding the word "restarting" (eg. a dot or a comma) so that the matchesPhrase is not validated without the wildcard.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GerardJ_0-1697012982204.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/14536iD46CF934D50DE0C4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GerardJ_0-1697012982204.png" alt="GerardJ_0-1697012982204.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 09:01:07 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Is-this-a-bug-Why-does-matchesPhrase-fail-and-at-the-same-time/m-p/225062#M284</guid>
      <dc:creator>GerardJ</dc:creator>
      <dc:date>2023-10-11T09:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: Is this a bug? Why does matchesPhrase fail and at the same time contains works?</title>
      <link>https://community.dynatrace.com/t5/DQL/Is-this-a-bug-Why-does-matchesPhrase-fail-and-at-the-same-time/m-p/225105#M286</link>
      <description>&lt;P&gt;If there was a dot or a common I'd see it. Added a &lt;STRONG&gt;==&lt;/STRONG&gt; to make the problem even more clear. Note that "restarting" obviously starts and ends with a word character, and before and after it are non-word characters, so it meets the criteria for matchesPhrase. I'll be doing training with some people at my company and at this point I will be recommending they use contains and not matchesPhrase.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// this finds data:&lt;/P&gt;&lt;P&gt;fetch events&lt;BR /&gt;| filter event.status != "CLOSED" and matchesPhrase(dt.kubernetes.event.message, "restarting") and &lt;STRONG&gt;contains&lt;/STRONG&gt;(event.name, "restarting")&lt;/P&gt;&lt;P&gt;| filter dt.kubernetes.event.message == event.name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// this does not find data (unless wildcards are added):&lt;/P&gt;&lt;P&gt;fetch events&amp;nbsp;&lt;BR /&gt;| filter event.status != "CLOSED" and matchesPhrase(dt.kubernetes.event.message, "restarting") and &lt;STRONG&gt;matchesPhrase&lt;/STRONG&gt;(event.name, "restarting")&lt;/P&gt;&lt;P&gt;| filter dt.kubernetes.event.message == event.name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can run the above queries using the demo site and get the same responses.&amp;nbsp;This is what the actual data looks like:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;timestamp&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;10/11/2023, 8:03:28 AM&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;event.name&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Back-off restarting failed&amp;nbsp; container&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;event.status&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;ACTIVE&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;dt.kubernetes.event.message&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Back-off restarting failed container&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 15:11:41 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Is-this-a-bug-Why-does-matchesPhrase-fail-and-at-the-same-time/m-p/225105#M286</guid>
      <dc:creator>GerrysR6</dc:creator>
      <dc:date>2023-10-11T15:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: Is this a bug? Why does matchesPhrase fail and at the same time contains works?</title>
      <link>https://community.dynatrace.com/t5/DQL/Is-this-a-bug-Why-does-matchesPhrase-fail-and-at-the-same-time/m-p/225115#M287</link>
      <description>&lt;P&gt;Unable to find documentation for "contains"...&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 16:03:59 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Is-this-a-bug-Why-does-matchesPhrase-fail-and-at-the-same-time/m-p/225115#M287</guid>
      <dc:creator>GerrysR6</dc:creator>
      <dc:date>2023-10-11T16:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: Is this a bug? Why does matchesPhrase fail and at the same time contains works?</title>
      <link>https://community.dynatrace.com/t5/DQL/Is-this-a-bug-Why-does-matchesPhrase-fail-and-at-the-same-time/m-p/225164#M292</link>
      <description>&lt;P&gt;I found this in the DQL docs :&amp;nbsp;&lt;A href="https://www.dynatrace.com/support/help/platform/grail/dynatrace-query-language/functions" target="_blank"&gt;DQL functions | Dynatrace Docs&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GerardJ_0-1697093044263.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/14555iEA897D8ECB2D8F97/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GerardJ_0-1697093044263.png" alt="GerardJ_0-1697093044263.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 06:46:22 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Is-this-a-bug-Why-does-matchesPhrase-fail-and-at-the-same-time/m-p/225164#M292</guid>
      <dc:creator>GerardJ</dc:creator>
      <dc:date>2023-10-12T06:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: Is this a bug? Why does matchesPhrase fail and at the same time contains works?</title>
      <link>https://community.dynatrace.com/t5/DQL/Is-this-a-bug-Why-does-matchesPhrase-fail-and-at-the-same-time/m-p/225236#M294</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/67468"&gt;@GerrysR6&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We have noticed that a bug was introduced when doing some special filtering operations (in your case filtering with matchesPhrase on event.name). The issue was already fixed and the fix will be rolled out with one of the next releases.&amp;nbsp; For more details about the fix, please reach out to&amp;nbsp;&lt;A href="https://one.dynatrace.com/hc/en-us/requests" target="_blank"&gt;Tech Support&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A workaround would be to use the lower function for event.name&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;fetch events
| filter event.status != "CLOSED" and matchesPhrase(dt.kubernetes.event.message, "restarting") and matchesPhrase(lower(event.name), "restarting")
| fields timestamp, event.name, event.status, dt.kubernetes.event.message
| limit 1000&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;BR /&gt;Sini&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 13:58:38 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Is-this-a-bug-Why-does-matchesPhrase-fail-and-at-the-same-time/m-p/225236#M294</guid>
      <dc:creator>sinisa_zubic</dc:creator>
      <dc:date>2023-10-12T13:58:38Z</dc:date>
    </item>
  </channel>
</rss>

