<?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: Extracting details from lookup DQL in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Extracting-details-from-lookup-DQL/m-p/227027#M324</link>
    <description>&lt;P&gt;This is indeed tough since the data is so deeply nested. While stating that, on the product side we can represent the software technologies data in an easier to use way, at least we can extract the data with DQL.&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;fetch dt.entity.process_group_instance 
| fieldsadd softwareTechnologies
| expand softwareTechnologies
| parse softwareTechnologies, "kvp{[a-z]*:key ':' LD:value (EOS|',')}:techs"
| fieldsflatten techs&lt;/LI-CODE&gt;
&lt;P&gt;What should also be stated that this is in many cases not necessary as we enrich that information e.g. on logs&lt;/P&gt;
&lt;P&gt;So you can directly group your data by technology:&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;fetch logs
| fields timestamp, process.technology
| expand process.technology&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Oct 2023 15:27:19 GMT</pubDate>
    <dc:creator>peter_zahrer</dc:creator>
    <dc:date>2023-10-30T15:27:19Z</dc:date>
    <item>
      <title>Extracting details from lookup DQL</title>
      <link>https://community.dynatrace.com/t5/DQL/Extracting-details-from-lookup-DQL/m-p/209780#M42</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I wanted to extract the &lt;STRONG&gt;type&lt;/STRONG&gt;, &lt;STRONG&gt;edition&lt;/STRONG&gt; and &lt;STRONG&gt;versions&lt;/STRONG&gt; out from the technologies to be different columns in a table as well as do a bar chart specifically for &lt;STRONG&gt;type&lt;/STRONG&gt;.&lt;/P&gt;
&lt;PRE&gt;"&lt;STRONG&gt;monitoringMode&lt;/STRONG&gt;": "FULL_STACK",&lt;BR /&gt;"&lt;STRONG&gt;lookup.entityId&lt;/STRONG&gt;": "PROCESS_GROUP_INSTANCE-61A60B5D26F3BB1B",&lt;BR /&gt;"&lt;STRONG&gt;lookup.entityName&lt;/STRONG&gt;": "com.dynatrace.easytravel.weblauncher.jar easytravel-*-x*",&lt;BR /&gt;"&lt;STRONG&gt;lookup.softwareTechnologies&lt;/STRONG&gt;": [&lt;BR /&gt;"type:QOS_LOGBACK,edition:null,version:1.2.3",&lt;BR /&gt;"type:APACHE_TOMCAT,edition:null,version:7.0.93.0",&lt;BR /&gt;"type:JAVA,edition:OpenJDK,version:11.0.5",&lt;BR /&gt;"type:JDK_HTTP_SERVER,edition:null,version:null",&lt;BR /&gt;"type:APACHE_TOMCAT,edition:null,version:null",&lt;BR /&gt;"type:JAVA,edition:null,version:null",&lt;BR /&gt;"type:APACHE_HTTP_CLIENT_SYNC,edition:null,version:4.5.10"&lt;BR /&gt;],&lt;/PRE&gt;
&lt;P&gt;Secondly, is there any way for me to change the name &lt;STRONG&gt;lookup.softwareTechnologies&lt;/STRONG&gt; to just&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;softwareTechnologies&lt;/STRONG&gt;. As I couldn't access it with the "."&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;monitoringMode&lt;/SPAN&gt;: record.&lt;SPAN&gt;values&lt;/SPAN&gt;?.&lt;SPAN&gt;monitoringMode &lt;/SPAN&gt;&lt;SPAN&gt;as string&lt;/SPAN&gt;,&lt;BR /&gt;&lt;STRONG&gt;softwareTechnologies: record.values?.softwareTechnologies,&lt;BR /&gt;&lt;BR /&gt;Failed with : &lt;BR /&gt;&lt;FONT color="#FF0000"&gt;softwareTechnologies: record.values?.lookup.softwareTechnologies,&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/PRE&gt;
&lt;P&gt;DQL:&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;fetch dt.entity.host, timeframe:"2023-03-01T00:00:00Z/2023-04-05T12:00:00Z"&lt;/SPAN&gt;&lt;BR /&gt;|fieldsAdd osVersion, cpuCores, memory = (memoryTotal/1000/1000000), ipAddress, monitoringMode&lt;BR /&gt;|lookup [fetch dt.entity.process_group_instance&lt;BR /&gt;|fieldsAdd softwareTechnologies, tags |filterOut contains (entityName, "OneAgent") OR contains (entityName, "Linux") OR contains (entityName, "sshd") OR contains (entityName, "Short-live") OR contains (entityName, "master") ], sourceField:tags, lookupField:tags&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 10:17:46 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Extracting-details-from-lookup-DQL/m-p/209780#M42</guid>
      <dc:creator>kwangxi</dc:creator>
      <dc:date>2023-05-30T10:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting details from lookup DQL</title>
      <link>https://community.dynatrace.com/t5/DQL/Extracting-details-from-lookup-DQL/m-p/209788#M43</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/58678"&gt;@kwangxi&lt;/a&gt;, you can extract type, edition, and version using the parse command. Something like this should work:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| filterOut ...
| parse softwareTechnologies[0], "'type:' WORD:type ',edition:' WORD:edition ',version:' WORD:version"&lt;/LI-CODE&gt;
&lt;P&gt;As for the second question, there's no way to remove the prefix completely, but you can change it with the prefix argument like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;lookup [
  ...
], sourceField:tags, lookupField:tags, prefix:"_"&lt;/LI-CODE&gt;
&lt;P&gt;Now you can access the values like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;record.values._softwareTechnologies
record.values._types
...&lt;/LI-CODE&gt;
&lt;P&gt;But I'm still curious why the access via lookup fails. Would you try this instead?&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;record.values["lookup.softwareTechnologies"]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 14:29:11 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Extracting-details-from-lookup-DQL/m-p/209788#M43</guid>
      <dc:creator>educampver</dc:creator>
      <dc:date>2023-04-13T14:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting details from lookup DQL</title>
      <link>https://community.dynatrace.com/t5/DQL/Extracting-details-from-lookup-DQL/m-p/209797#M44</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for the prefix, it would definitely be the solution for it.&lt;/P&gt;&lt;P&gt;Btw for this, it would only get the 1st array which is [0], is there any way to populate in for the rest of the arrays too?&lt;/P&gt;&lt;PRE&gt;| filterOut ...
| parse softwareTechnologies[0], "'type:' WORD:type ',edition:' WORD:edition ',version:' WORD:version"&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kwangxi_0-1681397460395.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/11128i0694A42749E81B59/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kwangxi_0-1681397460395.png" alt="kwangxi_0-1681397460395.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 14:53:14 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Extracting-details-from-lookup-DQL/m-p/209797#M44</guid>
      <dc:creator>kwangxi</dc:creator>
      <dc:date>2023-04-13T14:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting details from lookup DQL</title>
      <link>https://community.dynatrace.com/t5/DQL/Extracting-details-from-lookup-DQL/m-p/209810#M45</link>
      <description>&lt;P&gt;You're right! My bad. What you need is a bit more complex and I'm not sure the format you need it in, here's what I came up with:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| filterOut ...
| fieldsAdd technologiesString = toString(softwareTechnologies)
| parse technologiesString, "'[' ARRAY{'type:' WORD*:type (',edition:' LD ',version:' LD (', ' | ']'))}{1,}:types"
| parse technologiesString, "'[' ARRAY{'type:' LD ',edition:' WORD*:edition (',version:' LD (', ' | ']'))}{1,}:editions"
| parse technologiesString, "'[' ARRAY{'type:' LD ',edition:' LD ',version:' LD*:version (', ' | ']')}{1,}:versions"&lt;/LI-CODE&gt;
&lt;P&gt;This way, you'll have 3 arrays containing the types, editions, and versions. Additionally, if you need to remove the duplicates, you can use:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| fieldsAdd types = arrayDistinct(types), editions = arrayDistinct(editions), versions = arrayDistinct(versions)&lt;/LI-CODE&gt;
&lt;P&gt;Hope it works as expected this time.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 15:45:07 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Extracting-details-from-lookup-DQL/m-p/209810#M45</guid>
      <dc:creator>educampver</dc:creator>
      <dc:date>2023-04-13T15:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting details from lookup DQL</title>
      <link>https://community.dynatrace.com/t5/DQL/Extracting-details-from-lookup-DQL/m-p/209818#M47</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Previously, I was summarizing the monitoring mode to be in this way, so it can be captured and read by the DT chart.&lt;/P&gt;&lt;P&gt;I intend to achieve the software technologies in this way, may I ask is there any way to achieve this?&lt;BR /&gt;Let's say, for all 3 hosts, I found there are 3 Java so it would be:&lt;/P&gt;&lt;PRE&gt;{&lt;BR /&gt;"category": "JAVA",&lt;BR /&gt;"value": "3"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"category": "APACHE_TOMCAT",&lt;BR /&gt;"value": "1"&lt;BR /&gt;},&lt;BR /&gt;.....&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kwangxi_0-1681405285404.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/11130i2009107CBF2744A8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kwangxi_0-1681405285404.png" alt="kwangxi_0-1681405285404.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 17:03:31 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Extracting-details-from-lookup-DQL/m-p/209818#M47</guid>
      <dc:creator>kwangxi</dc:creator>
      <dc:date>2023-04-13T17:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting details from lookup DQL</title>
      <link>https://community.dynatrace.com/t5/DQL/Extracting-details-from-lookup-DQL/m-p/209976#M48</link>
      <description>&lt;P&gt;Unfortunately, I don't see how to achieve what you want in DQL. There's a big difference with the monitoring mode, and is that the monitoring mode is only one value per host, while the technologies are an array. I recommend doing a simple DQL query to get the raw data and parse and aggregate the technologies in code. Let me know if I can help with anything else.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2023 12:13:16 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Extracting-details-from-lookup-DQL/m-p/209976#M48</guid>
      <dc:creator>educampver</dc:creator>
      <dc:date>2023-04-17T12:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting details from lookup DQL</title>
      <link>https://community.dynatrace.com/t5/DQL/Extracting-details-from-lookup-DQL/m-p/227027#M324</link>
      <description>&lt;P&gt;This is indeed tough since the data is so deeply nested. While stating that, on the product side we can represent the software technologies data in an easier to use way, at least we can extract the data with DQL.&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;fetch dt.entity.process_group_instance 
| fieldsadd softwareTechnologies
| expand softwareTechnologies
| parse softwareTechnologies, "kvp{[a-z]*:key ':' LD:value (EOS|',')}:techs"
| fieldsflatten techs&lt;/LI-CODE&gt;
&lt;P&gt;What should also be stated that this is in many cases not necessary as we enrich that information e.g. on logs&lt;/P&gt;
&lt;P&gt;So you can directly group your data by technology:&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;fetch logs
| fields timestamp, process.technology
| expand process.technology&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2023 15:27:19 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Extracting-details-from-lookup-DQL/m-p/227027#M324</guid>
      <dc:creator>peter_zahrer</dc:creator>
      <dc:date>2023-10-30T15:27:19Z</dc:date>
    </item>
  </channel>
</rss>

