<?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 Using DQL or notebooks to pull the friendly name of relationships? in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Using-DQL-or-notebooks-to-pull-the-friendly-name-of/m-p/249837#M1026</link>
    <description>&lt;P&gt;Is anyone aware of a DQL statement or notebook that can be formulated to dynamically give the friendly name of entities based off relationships?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For Example HostIDXXXXXX to/from relationships in the api we get the Dynatrace IDs. In the past we had to create an api that would take the result of the Host ID GET then submit multiple gets for the relationship items that were formulated from the first GET, just to get the friendly name.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChadTurner_0-1720020592694.png" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/20938i7B3DA238E81734BE/image-size/large?v=v2&amp;amp;px=999" role="button" title="ChadTurner_0-1720020592694.png" alt="ChadTurner_0-1720020592694.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jul 2024 08:34:58 GMT</pubDate>
    <dc:creator>ChadTurner</dc:creator>
    <dc:date>2024-07-04T08:34:58Z</dc:date>
    <item>
      <title>Using DQL or notebooks to pull the friendly name of relationships?</title>
      <link>https://community.dynatrace.com/t5/DQL/Using-DQL-or-notebooks-to-pull-the-friendly-name-of/m-p/249837#M1026</link>
      <description>&lt;P&gt;Is anyone aware of a DQL statement or notebook that can be formulated to dynamically give the friendly name of entities based off relationships?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For Example HostIDXXXXXX to/from relationships in the api we get the Dynatrace IDs. In the past we had to create an api that would take the result of the Host ID GET then submit multiple gets for the relationship items that were formulated from the first GET, just to get the friendly name.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChadTurner_0-1720020592694.png" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/20938i7B3DA238E81734BE/image-size/large?v=v2&amp;amp;px=999" role="button" title="ChadTurner_0-1720020592694.png" alt="ChadTurner_0-1720020592694.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2024 08:34:58 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Using-DQL-or-notebooks-to-pull-the-friendly-name-of/m-p/249837#M1026</guid>
      <dc:creator>ChadTurner</dc:creator>
      <dc:date>2024-07-04T08:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using DQL or notebooks to pull the friendly name of relationships?</title>
      <link>https://community.dynatrace.com/t5/DQL/Using-DQL-or-notebooks-to-pull-the-friendly-name-of/m-p/249862#M1027</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/14877"&gt;@ChadTurner&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;Not sure about the Host to process correlation but host to host can be done there are two fields in dql that you can use to filter when you do "fetch dt.entity.host" they are calls and called_by which are pretty much self-explanatory.&amp;nbsp;&lt;BR /&gt;calls: The target hosts which our host is calling.&lt;BR /&gt;called_by: The hosts to which our host is the target host.&lt;BR /&gt;So here's the dql.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch dt.entity.host
| filter entity.detected_name == &amp;lt;Host's friendly name here&amp;gt;
| fields called_by
| expand called_by[dt.entity.host]
| lookup sourceField:`called_by[dt.entity.host]`, lookupField:id,[fetch dt.entity.host | fieldsAdd id]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;maybe you can edit this and add calls and called_by in the same query but yeah this is pretty much it.&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/76275"&gt;@Maheedhar_T&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 19:35:46 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Using-DQL-or-notebooks-to-pull-the-friendly-name-of/m-p/249862#M1027</guid>
      <dc:creator>Maheedhar_T</dc:creator>
      <dc:date>2024-07-03T19:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: Using DQL or notebooks to pull the friendly name of relationships?</title>
      <link>https://community.dynatrace.com/t5/DQL/Using-DQL-or-notebooks-to-pull-the-friendly-name-of/m-p/249921#M1028</link>
      <description>&lt;P&gt;If I understand correctly, this could be a solution:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch dt.entity.host
| filter id == "HOST-6C867CD1BF3229B0"
| fieldsAdd dt.entity.process_group=runs[dt.entity.process_group]
| expand dt.entity.process_group
| fields dt.entity.process_group, dt.entity.process_group.name = entityName(dt.entity.process_group)&lt;/LI-CODE&gt;&lt;P&gt;First get process groups entity IDs running on host and next lookup for their names. Result looks like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_0-1720109270777.png" style="width: 718px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/20956iB1533F887E8F34CF/image-dimensions/718x574?v=v2" width="718" height="574" role="button" title="krzysztof_hoja_0-1720109270777.png" alt="krzysztof_hoja_0-1720109270777.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I used works "lookup" on purpose, because &lt;EM&gt;&lt;STRONG&gt;entityName&lt;/STRONG&gt; &lt;/EM&gt;(and similar &lt;EM&gt;&lt;STRONG&gt;entityAttr&lt;/STRONG&gt;&lt;/EM&gt;) function is easy to use wrapper of for &lt;EM&gt;&lt;STRONG&gt;lookup&lt;/STRONG&gt; &lt;/EM&gt;command where you can get many more entity properties in one step:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch dt.entity.host
| filter id == "HOST-6C867CD1BF3229B0"
| fieldsAdd dt.entity.process_group=runs[dt.entity.process_group]
| expand dt.entity.process_group
| lookup [
  fetch dt.entity.process_group
  ], sourceField:dt.entity.process_group, lookupField:id, executionOrder:leftFirst,
  fields:{process_group.name=entity.name, process_group.softwareTechnologies=softwareTechnologies}
| fields dt.entity.process_group, process_group.name, process_group.softwareTechnologies&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_1-1720109700514.png" style="width: 774px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/20957i045EB3FC32B6274C/image-dimensions/774x654?v=v2" width="774" height="654" role="button" title="krzysztof_hoja_1-1720109700514.png" alt="krzysztof_hoja_1-1720109700514.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Kris&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2024 16:16:09 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Using-DQL-or-notebooks-to-pull-the-friendly-name-of/m-p/249921#M1028</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2024-07-04T16:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using DQL or notebooks to pull the friendly name of relationships?</title>
      <link>https://community.dynatrace.com/t5/DQL/Using-DQL-or-notebooks-to-pull-the-friendly-name-of/m-p/250084#M1033</link>
      <description>&lt;P&gt;Thank you all for your help on this!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2024 13:47:03 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Using-DQL-or-notebooks-to-pull-the-friendly-name-of/m-p/250084#M1033</guid>
      <dc:creator>ChadTurner</dc:creator>
      <dc:date>2024-07-08T13:47:03Z</dc:date>
    </item>
  </channel>
</rss>

