<?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 fields contains list of values in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/DQL-fields-contains-list-of-values/m-p/275488#M1957</link>
    <description>&lt;P&gt;More condensed version of such expressions (together with application example) looks like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;data record(reqPath="aaaa UID1 bbbb"),
record(reqPath="aaaa UID2 bbbb"),
record(reqPath="aaaa UID3 bbbb"),
record(reqPath="aaaa UID4 bbbb"),
record(reqPath="aaaa UID5 bbbb")
| fieldsAdd warning=if(iAny(contains(reqPath, array("UID1","UID3","UID5")[])),"warning")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;result:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_0-1745008658850.png" style="width: 830px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/27621i3243569E86FC728F/image-dimensions/830x552?v=v2" width="830" height="552" role="button" title="krzysztof_hoja_0-1745008658850.png" alt="krzysztof_hoja_0-1745008658850.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 18 Apr 2025 20:37:57 GMT</pubDate>
    <dc:creator>krzysztof_hoja</dc:creator>
    <dc:date>2025-04-18T20:37:57Z</dc:date>
    <item>
      <title>DQL fields contains list of values</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-fields-contains-list-of-values/m-p/272234#M1795</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;From my logs, i need to add a tag "warning" if the reqPath field contains one of ID like "UID1" "UID2" "UID3" "UID4".&lt;BR /&gt;Davis Copilot Answer to this question is :&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;fetch logs
| fieldsAdd warning = if(contains(reqPath, "UID1") OR contains(reqPath, "UID2") OR contains(reqPath, "UID3") OR contains(reqPath, "UID4"), "warning", else:NULL)&lt;/LI-CODE&gt;&lt;P&gt;It works but it's not possible to maintain with a list of hundreds of UID.&lt;/P&gt;&lt;P&gt;Is there a way in DQL to search a list of terms in a specific field?&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2025 13:54:21 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-fields-contains-list-of-values/m-p/272234#M1795</guid>
      <dc:creator>Nicolas_S</dc:creator>
      <dc:date>2025-03-12T13:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: DQL fields contains list of values</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-fields-contains-list-of-values/m-p/275083#M1941</link>
      <description>&lt;P class=""&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/56040"&gt;@Nicolas_S&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Yes, instead of listing each UID with contains(), you can use matchesValue() with wildcards if all your UIDs follow a common pattern.&lt;/P&gt;&lt;P class=""&gt;For example:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch logs
| fieldsAdd warning = if(matchesValue(reqPath, "*UID*"), "warning", else:NULL)&lt;/LI-CODE&gt;&lt;P class=""&gt;This will add the "warning" tag to any log where the reqPath contains something like "UID".&lt;/P&gt;&lt;P class=""&gt;It’s much simpler and easier to maintain when you have many UIDs with a similar format.&lt;/P&gt;&lt;P class=""&gt;Best regards!&lt;/P&gt;</description>
      <pubDate>Mon, 14 Apr 2025 12:30:40 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-fields-contains-list-of-values/m-p/275083#M1941</guid>
      <dc:creator>JeanBlanc</dc:creator>
      <dc:date>2025-04-14T12:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: DQL fields contains list of values</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-fields-contains-list-of-values/m-p/275488#M1957</link>
      <description>&lt;P&gt;More condensed version of such expressions (together with application example) looks like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;data record(reqPath="aaaa UID1 bbbb"),
record(reqPath="aaaa UID2 bbbb"),
record(reqPath="aaaa UID3 bbbb"),
record(reqPath="aaaa UID4 bbbb"),
record(reqPath="aaaa UID5 bbbb")
| fieldsAdd warning=if(iAny(contains(reqPath, array("UID1","UID3","UID5")[])),"warning")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;result:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_0-1745008658850.png" style="width: 830px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/27621i3243569E86FC728F/image-dimensions/830x552?v=v2" width="830" height="552" role="button" title="krzysztof_hoja_0-1745008658850.png" alt="krzysztof_hoja_0-1745008658850.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2025 20:37:57 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-fields-contains-list-of-values/m-p/275488#M1957</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2025-04-18T20:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: DQL fields contains list of values</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-fields-contains-list-of-values/m-p/275501#M1958</link>
      <description>&lt;P&gt;I would recommend using the &lt;A href="https://docs.dynatrace.com/docs/discover-dynatrace/references/dynatrace-query-language/functions/string-functions#matchesPattern" target="_self"&gt;matchesPattern&lt;/A&gt; function for this scenario. This function allows you to test whether the field matches a specific &lt;A href="https://docs.dynatrace.com/docs/discover-dynatrace/references/dynatrace-pattern-language" target="_self"&gt;DPL&lt;/A&gt; pattern.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2025 21:56:18 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-fields-contains-list-of-values/m-p/275501#M1958</guid>
      <dc:creator>marco_irmer</dc:creator>
      <dc:date>2025-04-18T21:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: DQL fields contains list of values</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-fields-contains-list-of-values/m-p/275721#M1976</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;Thank you that's exactly what i was looking for.&lt;/P&gt;&lt;P&gt;The fields values are not UID1 UID2 and so on but real UID like 587a4b2c-9d3e-1f0g, a1b2-c3d4-e5f6-7890, etc which are very difficult to use with DPL or wildcards solutions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Apr 2025 07:43:12 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-fields-contains-list-of-values/m-p/275721#M1976</guid>
      <dc:creator>Nicolas_S</dc:creator>
      <dc:date>2025-04-23T07:43:12Z</dc:date>
    </item>
  </channel>
</rss>

