<?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 parsing Json and extracting new column in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/DQL-parsing-Json-and-extracting-new-column/m-p/253305#M1123</link>
    <description>&lt;P class="lia-align-left"&gt;Thanks to internal Dynatrace help I was able to solve this.&lt;BR /&gt;&lt;BR /&gt;The new Processor worked like this:&lt;BR /&gt;&lt;BR /&gt;parse custom_headers[0],"JSON:temp1"&lt;BR /&gt;|parse custom_headers[1],"JSON:temp2"&lt;BR /&gt;|fieldsAdd SalesOrderId = if(temp1[name] == "SalesOrderId",temp1[value],else:temp2[value])&lt;BR /&gt;&lt;BR /&gt;The two first line defines separate Json from the whole array (the one in position [0] and the on in [1]).&lt;BR /&gt;The last line adds a field called SalesOrderID and the value will match&amp;nbsp;&amp;nbsp;temp1[value] if&amp;nbsp;temp1[name] == "SalesOrderId" or will match&amp;nbsp;temp2[value]&amp;nbsp; if&amp;nbsp;temp1[name] will not be"SalesOrderId".&lt;BR /&gt;&lt;BR /&gt;Regards&lt;/P&gt;</description>
    <pubDate>Tue, 13 Aug 2024 13:56:42 GMT</pubDate>
    <dc:creator>y_buccellato</dc:creator>
    <dc:date>2024-08-13T13:56:42Z</dc:date>
    <item>
      <title>DQL parsing Json and extracting new column</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-parsing-Json-and-extracting-new-column/m-p/253165#M1121</link>
      <description>&lt;P&gt;Good afternoon community,&lt;/P&gt;&lt;P&gt;in my log line I have a field called:&lt;/P&gt;&lt;P&gt;custom_headers&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="y_buccellato_1-1723466812323.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/21726iEA813CC75F36660A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="y_buccellato_1-1723466812323.png" alt="y_buccellato_1-1723466812323.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;custom headers contains this value:&lt;BR /&gt;&lt;BR /&gt;{"id":"261004620","name":"OrderId","value":"5602867201"},&lt;BR /&gt;{"id":"260996569","name":"xxxxother","value":"xxxxxx"}&lt;BR /&gt;&lt;BR /&gt;out of all of it I'd like to extract and keep:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;OrderId&amp;nbsp;&lt;/STRONG&gt;as the name of the column&amp;nbsp;and then each row to be the actual id ("value":"56xxxxx")&lt;BR /&gt;&lt;BR /&gt;Reviewed DPL/DQL but things are quite complex,&lt;BR /&gt;thanks for any help here,&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;&lt;BR /&gt;Yann&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2024 12:49:32 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-parsing-Json-and-extracting-new-column/m-p/253165#M1121</guid>
      <dc:creator>y_buccellato</dc:creator>
      <dc:date>2024-08-12T12:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: DQL parsing Json and extracting new column</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-parsing-Json-and-extracting-new-column/m-p/253305#M1123</link>
      <description>&lt;P class="lia-align-left"&gt;Thanks to internal Dynatrace help I was able to solve this.&lt;BR /&gt;&lt;BR /&gt;The new Processor worked like this:&lt;BR /&gt;&lt;BR /&gt;parse custom_headers[0],"JSON:temp1"&lt;BR /&gt;|parse custom_headers[1],"JSON:temp2"&lt;BR /&gt;|fieldsAdd SalesOrderId = if(temp1[name] == "SalesOrderId",temp1[value],else:temp2[value])&lt;BR /&gt;&lt;BR /&gt;The two first line defines separate Json from the whole array (the one in position [0] and the on in [1]).&lt;BR /&gt;The last line adds a field called SalesOrderID and the value will match&amp;nbsp;&amp;nbsp;temp1[value] if&amp;nbsp;temp1[name] == "SalesOrderId" or will match&amp;nbsp;temp2[value]&amp;nbsp; if&amp;nbsp;temp1[name] will not be"SalesOrderId".&lt;BR /&gt;&lt;BR /&gt;Regards&lt;/P&gt;</description>
      <pubDate>Tue, 13 Aug 2024 13:56:42 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-parsing-Json-and-extracting-new-column/m-p/253305#M1123</guid>
      <dc:creator>y_buccellato</dc:creator>
      <dc:date>2024-08-13T13:56:42Z</dc:date>
    </item>
  </channel>
</rss>

