<?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 handling tag values in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Handle-Tag-Values-in-Dynatrace-Query-Language-DQL/m-p/272217#M1793</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/56833"&gt;@Tiit_Hallas&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks for the DQL which you shared.&amp;nbsp;&lt;BR /&gt;Could you please help me on fixing this problem where I am working on setting up segment using tags present on hosts.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Environment: prod/non-prod/uat/test/stage&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Application Name: Atlas, cardwizard etc&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I was using below DQL to filter the tags of application:&amp;lt;application name&amp;gt; which is working fine for me.&lt;/P&gt;&lt;P&gt;Dql:&amp;nbsp;&lt;/P&gt;&lt;P&gt;fetch dt.entity.host&lt;/P&gt;&lt;P&gt;| fields tags&lt;/P&gt;&lt;P&gt;| expand tags&lt;/P&gt;&lt;P&gt;| filter contains(toString(tags),"application:")&lt;/P&gt;&lt;P&gt;| parse tags, "ld:key ':' ld:ApplicationName"&lt;/P&gt;&lt;P&gt;| fields ApplicationName&lt;/P&gt;&lt;P&gt;| dedup ApplicationName&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I also want to add one more field/column which can filter the environment from the tags such as &lt;STRONG&gt;environment:&amp;lt;env_name&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The tags applied on hosts are listed below where I can filter application name but not able to filter environment prod in separate column&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tags = [&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;STRONG&gt;"environment:prod",&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; "iis app pool:DefaultAppPool",&lt;/P&gt;&lt;P&gt;&amp;nbsp; "iis app pool:MiserRiskAssessment",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;STRONG&gt;"application:atlas"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;application names are successfully filtered however environment I am not getting in another field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Parkash_Jha_1_0-1741782398685.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/26902iB89CB7EE1E3B81AB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Parkash_Jha_1_0-1741782398685.png" alt="Parkash_Jha_1_0-1741782398685.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Mar 2025 12:30:50 GMT</pubDate>
    <dc:creator>Parkash_Jha_1</dc:creator>
    <dc:date>2025-03-12T12:30:50Z</dc:date>
    <item>
      <title>Handle Tag Values in Dynatrace Query Language (DQL)</title>
      <link>https://community.dynatrace.com/t5/DQL/Handle-Tag-Values-in-Dynatrace-Query-Language-DQL/m-p/214038#M80</link>
      <description>&lt;P&gt;&lt;EM&gt;Summary:&amp;nbsp;This article demonstrates how to handle tag values in DQL queries, including syntax examples and practical use cases for filtering and grouping data in Dynatrace dashboards.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Hi, I defined some tags in the key:value format.&lt;/P&gt;
&lt;P&gt;Now I'd like to use tag values in DQL.&lt;/P&gt;
&lt;P&gt;For example, I defined the tag "myTag" for which its value is a substring of the webservice namespace. Now I'd like to summarize service count by tag value. Below DQL is used for extraction, but then how can I summarize by tag value?&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;fetch dt.entity.service&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;| fieldsAdd runs_on, tags&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;| filter matchesValue(tags, "myTag")&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;If I add&lt;BR /&gt;&lt;EM&gt;| summarize count(), by:{tags&lt;/EM&gt;}&lt;/P&gt;
&lt;P&gt;I found no way to use tag value.&lt;/P&gt;
&lt;P&gt;thanks&lt;BR /&gt;Paolo&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jan 2026 10:55:31 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Handle-Tag-Values-in-Dynatrace-Query-Language-DQL/m-p/214038#M80</guid>
      <dc:creator>paolo_fumanelli</dc:creator>
      <dc:date>2026-01-21T10:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: DQL handling tag values</title>
      <link>https://community.dynatrace.com/t5/DQL/Handle-Tag-Values-in-Dynatrace-Query-Language-DQL/m-p/215804#M81</link>
      <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/19328"&gt;@paolo_fumanelli&lt;/a&gt;&amp;nbsp;have you had any luck figuring out the tags with DQL?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 13:04:06 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Handle-Tag-Values-in-Dynatrace-Query-Language-DQL/m-p/215804#M81</guid>
      <dc:creator>ChadTurner</dc:creator>
      <dc:date>2023-06-22T13:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: DQL handling tag values</title>
      <link>https://community.dynatrace.com/t5/DQL/Handle-Tag-Values-in-Dynatrace-Query-Language-DQL/m-p/215820#M82</link>
      <description>&lt;P&gt;Hi Chad,&lt;/P&gt;&lt;P&gt;after several attempts I tried this. I wanted to group and count websphere services by a specific tag&lt;/P&gt;&lt;P&gt;fetch dt.entity.service&lt;BR /&gt;| fieldsAdd softwareTechnologies, tags&lt;BR /&gt;| filter contains(toString(softwareTechnologies), "IBM_WEBSPHERE_APPLICATION_SERVER")&lt;BR /&gt;| filter contains(toString(tags), "myTag")&lt;BR /&gt;| summarize count(), by:{(tags)}&lt;BR /&gt;| sort `count()` desc&lt;/P&gt;&lt;P&gt;The result is not exactly the one I wanted because if a service has got more that 1 tag, not only "myTag" will be used to produce the grouping but also the other ones.&lt;/P&gt;&lt;P&gt;But, still, it's one step further &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Of course if you have any hint, more than welcome!&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 14:46:13 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Handle-Tag-Values-in-Dynatrace-Query-Language-DQL/m-p/215820#M82</guid>
      <dc:creator>paolo_fumanelli</dc:creator>
      <dc:date>2023-06-22T14:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: DQL handling tag values</title>
      <link>https://community.dynatrace.com/t5/DQL/Handle-Tag-Values-in-Dynatrace-Query-Language-DQL/m-p/216880#M112</link>
      <description>&lt;P&gt;Your current solution does not take into account a situation, where your defined tag is a substring of a larger tag. E.g. you're looking for a tag "dce", then your query would match things tagged with "abcde" as well.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could consider the following query, maybe this helps:&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;fetch dt.entity.service
| fieldsAdd softwareTechnologies, tags
| filter matchesValue(tags, "my_tag")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2023 10:57:32 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Handle-Tag-Values-in-Dynatrace-Query-Language-DQL/m-p/216880#M112</guid>
      <dc:creator>Tiit_Hallas</dc:creator>
      <dc:date>2023-07-04T10:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: DQL handling tag values</title>
      <link>https://community.dynatrace.com/t5/DQL/Handle-Tag-Values-in-Dynatrace-Query-Language-DQL/m-p/216886#M113</link>
      <description>&lt;P&gt;Hi, thanks for hint. I tried your solution at the beginning but it does work if the tag is not in the key:value format.&lt;/P&gt;&lt;P&gt;Since in my case "myTag" key can assume several different values, if I use matchesValue(tags, "myTag") I wont' get any result.&lt;/P&gt;&lt;P&gt;It will provide results only by specifiying also the value, like&lt;/P&gt;&lt;P&gt;| filter matchesValue(tags, "myTag:myTagValue")&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2023 12:11:15 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Handle-Tag-Values-in-Dynatrace-Query-Language-DQL/m-p/216886#M113</guid>
      <dc:creator>paolo_fumanelli</dc:creator>
      <dc:date>2023-07-04T12:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: DQL handling tag values</title>
      <link>https://community.dynatrace.com/t5/DQL/Handle-Tag-Values-in-Dynatrace-Query-Language-DQL/m-p/217112#M126</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since the "tags" is essentially an array with multiple values, you would need to do an "expand" on that field. the matchesValue means that the value has to be exactly the same. If your tags contains a key:value pair, then you can also use a "contains"&lt;/P&gt;&lt;P&gt;fetch dt.entity.service&lt;BR /&gt;| fieldsAdd softwareTechnologies, tags&lt;BR /&gt;| expand tags&lt;BR /&gt;| filter contains(tags, "mytag")&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 12:53:33 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Handle-Tag-Values-in-Dynatrace-Query-Language-DQL/m-p/217112#M126</guid>
      <dc:creator>AmitChiba</dc:creator>
      <dc:date>2023-07-06T12:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: DQL handling tag values</title>
      <link>https://community.dynatrace.com/t5/DQL/Handle-Tag-Values-in-Dynatrace-Query-Language-DQL/m-p/217116#M127</link>
      <description>&lt;P&gt;ah, clear. In that case it makes sense to use contains indeed. and the full solution for you might be something like this:&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;fetch dt.entity.service
| fieldsAdd softwareTechnologies, tags
| filter contains(toString(softwareTechnologies), "IBM_WEBSPHERE_APPLICATION_SERVER")
| expand tags
| filter contains(toString(tags), "&amp;lt;my_tag&amp;gt;:") // mind the colon at the end
| parse tags, "ld:key ':' ld:tag_value"
| summarize count(), by: {tag_value}
&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 06 Jul 2023 13:12:52 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Handle-Tag-Values-in-Dynatrace-Query-Language-DQL/m-p/217116#M127</guid>
      <dc:creator>Tiit_Hallas</dc:creator>
      <dc:date>2023-07-06T13:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: DQL handling tag values</title>
      <link>https://community.dynatrace.com/t5/DQL/Handle-Tag-Values-in-Dynatrace-Query-Language-DQL/m-p/217119#M129</link>
      <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/877"&gt;@AmitChiba&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/56833"&gt;@Tiit_Hallas&lt;/a&gt;&amp;nbsp;you were great!&lt;/P&gt;&lt;P&gt;Both your solutions work very well for my case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Paolo&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 13:30:01 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Handle-Tag-Values-in-Dynatrace-Query-Language-DQL/m-p/217119#M129</guid>
      <dc:creator>paolo_fumanelli</dc:creator>
      <dc:date>2023-07-06T13:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: DQL handling tag values</title>
      <link>https://community.dynatrace.com/t5/DQL/Handle-Tag-Values-in-Dynatrace-Query-Language-DQL/m-p/272217#M1793</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/56833"&gt;@Tiit_Hallas&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks for the DQL which you shared.&amp;nbsp;&lt;BR /&gt;Could you please help me on fixing this problem where I am working on setting up segment using tags present on hosts.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Environment: prod/non-prod/uat/test/stage&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Application Name: Atlas, cardwizard etc&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I was using below DQL to filter the tags of application:&amp;lt;application name&amp;gt; which is working fine for me.&lt;/P&gt;&lt;P&gt;Dql:&amp;nbsp;&lt;/P&gt;&lt;P&gt;fetch dt.entity.host&lt;/P&gt;&lt;P&gt;| fields tags&lt;/P&gt;&lt;P&gt;| expand tags&lt;/P&gt;&lt;P&gt;| filter contains(toString(tags),"application:")&lt;/P&gt;&lt;P&gt;| parse tags, "ld:key ':' ld:ApplicationName"&lt;/P&gt;&lt;P&gt;| fields ApplicationName&lt;/P&gt;&lt;P&gt;| dedup ApplicationName&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I also want to add one more field/column which can filter the environment from the tags such as &lt;STRONG&gt;environment:&amp;lt;env_name&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The tags applied on hosts are listed below where I can filter application name but not able to filter environment prod in separate column&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tags = [&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;STRONG&gt;"environment:prod",&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; "iis app pool:DefaultAppPool",&lt;/P&gt;&lt;P&gt;&amp;nbsp; "iis app pool:MiserRiskAssessment",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;STRONG&gt;"application:atlas"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;application names are successfully filtered however environment I am not getting in another field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Parkash_Jha_1_0-1741782398685.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/26902iB89CB7EE1E3B81AB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Parkash_Jha_1_0-1741782398685.png" alt="Parkash_Jha_1_0-1741782398685.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2025 12:30:50 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Handle-Tag-Values-in-Dynatrace-Query-Language-DQL/m-p/272217#M1793</guid>
      <dc:creator>Parkash_Jha_1</dc:creator>
      <dc:date>2025-03-12T12:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: DQL handling tag values</title>
      <link>https://community.dynatrace.com/t5/DQL/Handle-Tag-Values-in-Dynatrace-Query-Language-DQL/m-p/272219#M1794</link>
      <description>&lt;P&gt;If you want to also have environment in another column, you must add them again. Example:&lt;/P&gt;&lt;P&gt;fetch dt.entity.host&lt;BR /&gt;| fieldsAdd a = tags | expand a | filter contains(a,"application:")&lt;BR /&gt;.....&lt;BR /&gt;| fieldsAdd t = tags | expand t | filter contains(t,"environment:")&lt;BR /&gt;....&lt;/P&gt;&lt;P&gt;This will create a new column with environment&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2025 12:53:46 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Handle-Tag-Values-in-Dynatrace-Query-Language-DQL/m-p/272219#M1794</guid>
      <dc:creator>paolo_fumanelli</dc:creator>
      <dc:date>2025-03-12T12:53:46Z</dc:date>
    </item>
  </channel>
</rss>

