<?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: Passing Result of DPL Query in WorkFlow in Automations</title>
    <link>https://community.dynatrace.com/t5/Automations/Pass-the-Result-of-DQL-Query-in-Workflow/m-p/259310#M1837</link>
    <description>&lt;P&gt;&amp;nbsp;The main blocker in my DQL is, how to pass JSON outputs&lt;/P&gt;</description>
    <pubDate>Tue, 15 Oct 2024 12:36:12 GMT</pubDate>
    <dc:creator>nicemukesh</dc:creator>
    <dc:date>2024-10-15T12:36:12Z</dc:date>
    <item>
      <title>Pass the Result of DQL Query in Workflow</title>
      <link>https://community.dynatrace.com/t5/Automations/Pass-the-Result-of-DQL-Query-in-Workflow/m-p/258736#M1827</link>
      <description>&lt;P&gt;While working with Workflows, I noticed that the Result that is returned from a TASK1 DQL Query in a workflow is in a JSON format, and when I try passing that onto another DQL query, it gives an error.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;So i would like to know how to pass result of task1 to next task1 in workflow and also how to parse it?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Dec 2025 11:59:32 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Pass-the-Result-of-DQL-Query-in-Workflow/m-p/258736#M1827</guid>
      <dc:creator>nicemukesh</dc:creator>
      <dc:date>2025-12-15T11:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Result of DPL Query in WorkFlow</title>
      <link>https://community.dynatrace.com/t5/Automations/Pass-the-Result-of-DQL-Query-in-Workflow/m-p/258740#M1828</link>
      <description>&lt;P&gt;I'm not exactly sure what you're asking about, but you might need to use the expression filters to_json or from_json like so:&amp;nbsp; {{result("task1")|from_json}}&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2024 14:24:04 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Pass-the-Result-of-DQL-Query-in-Workflow/m-p/258740#M1828</guid>
      <dc:creator>StrangerThing</dc:creator>
      <dc:date>2024-10-09T14:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Result of DPL Query in WorkFlow</title>
      <link>https://community.dynatrace.com/t5/Automations/Pass-the-Result-of-DQL-Query-in-Workflow/m-p/258743#M1829</link>
      <description>&lt;P&gt;Thanks for your reply..&lt;/P&gt;&lt;P&gt;Actually i am passing result from Task1 to Task2 in workflow.&amp;nbsp;Right now, i am getting result of Task1 in JSON format.&amp;nbsp;And trying to parse it so that it would become huma readable format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2024 14:30:00 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Pass-the-Result-of-DQL-Query-in-Workflow/m-p/258743#M1829</guid>
      <dc:creator>nicemukesh</dc:creator>
      <dc:date>2024-10-09T14:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Result of DPL Query in WorkFlow</title>
      <link>https://community.dynatrace.com/t5/Automations/Pass-the-Result-of-DQL-Query-in-Workflow/m-p/258744#M1830</link>
      <description>&lt;P&gt;You can use the parse command in DQL to parse the json into a record with the fields.&amp;nbsp;&lt;BR /&gt;&lt;A href="https://docs.dynatrace.com/docs/platform/grail/dynatrace-query-language/commands/extraction-and-parsing-commands#parse" target="_blank"&gt;Extraction and parsing commands - Dynatrace Docs&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2024 14:32:57 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Pass-the-Result-of-DQL-Query-in-Workflow/m-p/258744#M1830</guid>
      <dc:creator>StrangerThing</dc:creator>
      <dc:date>2024-10-09T14:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Result of DPL Query in WorkFlow</title>
      <link>https://community.dynatrace.com/t5/Automations/Pass-the-Result-of-DQL-Query-in-Workflow/m-p/258745#M1831</link>
      <description>&lt;P&gt;&lt;SPAN&gt;This is error coming while running it&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Error evaluating 'query' in input. the JSON object must be str, bytes or bytearray, not dict Use the expression preview in edit mode to review the input.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2024 14:40:08 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Pass-the-Result-of-DQL-Query-in-Workflow/m-p/258745#M1831</guid>
      <dc:creator>nicemukesh</dc:creator>
      <dc:date>2024-10-09T14:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Result of DPL Query in WorkFlow</title>
      <link>https://community.dynatrace.com/t5/Automations/Pass-the-Result-of-DQL-Query-in-Workflow/m-p/258748#M1832</link>
      <description>&lt;P&gt;That's where you'll need to use the "to_json" expression filter like I mentioned earlier. Something like this:&amp;nbsp; {{result("task1")|to_json}}&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2024 14:58:28 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Pass-the-Result-of-DQL-Query-in-Workflow/m-p/258748#M1832</guid>
      <dc:creator>StrangerThing</dc:creator>
      <dc:date>2024-10-09T14:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Result of DPL Query in WorkFlow</title>
      <link>https://community.dynatrace.com/t5/Automations/Pass-the-Result-of-DQL-Query-in-Workflow/m-p/258814#M1833</link>
      <description>&lt;P&gt;I tried to parse&amp;nbsp;&lt;SPAN&gt;into a record with the fields, but it is not fetching result.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;data json:"""[{{result("task1")|to_json}}]"""&lt;BR /&gt;| parse content, "JSON:json"&lt;BR /&gt;| fields "Namespace"&lt;/P&gt;&lt;P&gt;I am trying to print an output of TASK 1 into tabular format&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 12:49:46 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Pass-the-Result-of-DQL-Query-in-Workflow/m-p/258814#M1833</guid>
      <dc:creator>nicemukesh</dc:creator>
      <dc:date>2024-10-10T12:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Result of DPL Query in WorkFlow</title>
      <link>https://community.dynatrace.com/t5/Automations/Pass-the-Result-of-DQL-Query-in-Workflow/m-p/258840#M1834</link>
      <description>&lt;P&gt;When viewing your Workflow execution, you can see the result of your "task1". You may need to get into a field before you actually can access the data returned. For example, you may need to use {{ result("task1").records }} to access the "records" field of the result.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's hard to determine exactly what you're trying to do with limited information, so sorry if this doesn't help you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 15:28:02 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Pass-the-Result-of-DQL-Query-in-Workflow/m-p/258840#M1834</guid>
      <dc:creator>StrangerThing</dc:creator>
      <dc:date>2024-10-10T15:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Result of DPL Query in WorkFlow</title>
      <link>https://community.dynatrace.com/t5/Automations/Pass-the-Result-of-DQL-Query-in-Workflow/m-p/259169#M1835</link>
      <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/70937"&gt;@nicemukesh&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;Let me try to explain this with an example.&lt;BR /&gt;The first task is a DQL and the result would obviously be a JSON value.&lt;BR /&gt;What I assume here is from the JSON you are getting you want a particular field to be used in another DQL which would require you to loop through the result of first task.&lt;BR /&gt;&lt;BR /&gt;Just let me try to explain this with an example.&lt;BR /&gt;Here I am taking two DQLs first one gets the hosts which have CPU usage greater than 50%.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries by:{dt.entity.host}, cpu_usage = avg(dt.host.cpu.usage)
| filter arrayAvg(cpu_usage) &amp;gt; 50
| lookup [fetch dt.entity.host], sourceField:dt.entity.host, lookupField:id, fields:{entity.name}&lt;/LI-CODE&gt;&lt;P&gt;The second DQL gets the host details by host id&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch dt.entity.host
| fields id == ""&lt;/LI-CODE&gt;&lt;P&gt;Now I do not want to pass the id as a static or hardcoded value rather I would like to pass host id of the hosts that came up in the first DQL result.&lt;BR /&gt;&lt;BR /&gt;Now the sample result of first DQL would be something like this.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "status": "NONE",
    "content": "2023-01-01T01:01:01Z localhost proxy[12529]: 10.0.0.10:38440 http-in~ individual_servers/abc 217/0/0/1/218 HTTP_STATUS 200 284 - - --NN 5749/5745/0/1/0 0/0 {|||some.domain.com:443} {|} \"POST /path?param=foo HTTP/1.1\" ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2",
    "content2": "2023-01-01T01:01:01Z localhost proxy[12529]: 10.0.0.10:38440 http-in~ individual_servers/abc 217/0/0/1/218 HTTP_STATUS 200 284 - - --NN 5749/5745/0/1/0 0/0 {|||some.domain.com:443} {|} \"POST /path?param=foo HTTP/1.1\" ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2",
    "loglevel": "NONE",
    "host.name": "HOST-IG-12-34567",
    "timestamp": "2023-01-01T01:01:01.000000001Z",
    "event.type": "LOG",
    "log.source": "/var/spool/some.log",
    "dt.entity.host": "HOST-1234567890",
    "dt.source_entity": "PROCESS_GROUP_INSTANCE-ABCDEF1234567",
    "dt.security_context": "application-a",
    "dt.entity.process_group": "PROCESS_GROUP-ABCDEF1234567",
    "dt.entity.process_group_instance": "PROCESS_GROUP_INSTANCE-ABCDEF1234567"
  },
  {
    "status": "NONE",
    "content": "2023-01-01T01:01:01Z localhost proxy[12529]: 10.0.0.10:38440 http-in~ individual_servers/abc 217/0/0/1/218 HTTP_STATUS 200 284 - - --NN 5749/5745/0/1/0 0/0 {|||some.domain.com:443} {|} \"POST /path?param=foo HTTP/1.1\" ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2",
    "content2": "2023-01-01T01:01:01Z localhost proxy[12529]: 10.0.0.10:38440 http-in~ individual_servers/abc 217/0/0/1/218 HTTP_STATUS 200 284 - - --NN 5749/5745/0/1/0 0/0 {|||some.domain.com:443} {|} \"POST /path?param=foo HTTP/1.1\" ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2",
    "loglevel": "NONE",
    "host.name": "HOST-IG-12-34567",
    "timestamp": "2023-01-01T01:01:01.000000002Z",
    "event.type": "LOG",
    "log.source": "/var/spool/some.log",
    "dt.entity.host": "HOST-1234567890",
    "dt.source_entity": "PROCESS_GROUP_INSTANCE-ABCDEF1234567",
    "dt.security_context": "application-a",
    "dt.entity.process_group": "PROCESS_GROUP-ABCDEF1234567",
    "dt.entity.process_group_instance": "PROCESS_GROUP_INSTANCE-ABCDEF1234567"
  }
]&lt;/LI-CODE&gt;&lt;P&gt;from this I want to extract the field&amp;nbsp;&lt;STRONG&gt;dt.entity.host&amp;nbsp;&lt;/STRONG&gt;and then use it in second DQL.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Now let's see the workflow part of it.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Maheedhar_T_0-1728913189308.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/23611iD549A82B80DB59F9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Maheedhar_T_0-1728913189308.png" alt="Maheedhar_T_0-1728913189308.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This what our workflow looks like and let me break down stepwise.&lt;BR /&gt;The first step is hosts_cpu which is pretty standard just give the first DQL mentioned above.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Maheedhar_T_1-1728913261338.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/23612iB436DB72F185A66E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Maheedhar_T_1-1728913261338.png" alt="Maheedhar_T_1-1728913261338.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now coming to the second step, this should be a loop task so go to the Options first and enable loop task. Now we want to loop this task over all the records that we get the output of step-1 (hosts_cpu) so we configure something like this.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Maheedhar_T_2-1728913368638.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/23613i9609C20137568B8B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Maheedhar_T_2-1728913368638.png" alt="Maheedhar_T_2-1728913368638.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In the list you have to give something like&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{{ result("hosts_cpu")["records"] }}&lt;/LI-CODE&gt;&lt;P&gt;don't worry about how I got this. Just under the list you'll see option expand the list if you click that expand in the box and start typing records, you'll get the options.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Maheedhar_T_3-1728913766537.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/23614i3BBCEE0B9274E874/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Maheedhar_T_3-1728913766537.png" alt="Maheedhar_T_3-1728913766537.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now the loop is in place, and we have to use that loop variable and then extract dt.entity.host from that variable.&lt;BR /&gt;So the actual DQL in the second task becomes this.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Maheedhar_T_4-1728913970700.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/23615iF9AEE7F9F84D9AA4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Maheedhar_T_4-1728913970700.png" alt="Maheedhar_T_4-1728913970700.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The DQL if expanded, looks like&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch dt.entity.host
| filter id == "{{ _.item ['dt.entity.host'] | replace('"', "")}}"&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Also, don't bother about the replace part I had to use it because I was getting only one " like HOST-ABC12345" and I had to remove that " for the DQL to work properly.&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&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;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2024 13:55:05 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Pass-the-Result-of-DQL-Query-in-Workflow/m-p/259169#M1835</guid>
      <dc:creator>Maheedhar_T</dc:creator>
      <dc:date>2024-10-14T13:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Result of DPL Query in WorkFlow</title>
      <link>https://community.dynatrace.com/t5/Automations/Pass-the-Result-of-DQL-Query-in-Workflow/m-p/259246#M1836</link>
      <description>&lt;P&gt;Thanks for your detailed explanation.. It is great help.&lt;/P&gt;&lt;P&gt;I will check it from my end and will keep posted on this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mukesh&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 07:20:52 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Pass-the-Result-of-DQL-Query-in-Workflow/m-p/259246#M1836</guid>
      <dc:creator>nicemukesh</dc:creator>
      <dc:date>2024-10-15T07:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Result of DPL Query in WorkFlow</title>
      <link>https://community.dynatrace.com/t5/Automations/Pass-the-Result-of-DQL-Query-in-Workflow/m-p/259310#M1837</link>
      <description>&lt;P&gt;&amp;nbsp;The main blocker in my DQL is, how to pass JSON outputs&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 12:36:12 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/Pass-the-Result-of-DQL-Query-in-Workflow/m-p/259310#M1837</guid>
      <dc:creator>nicemukesh</dc:creator>
      <dc:date>2024-10-15T12:36:12Z</dc:date>
    </item>
  </channel>
</rss>

