<?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: Is there a reverse command of fieldsFlatten? in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Is-there-a-reverse-command-of-fieldsFlatten/m-p/263213#M1466</link>
    <description>&lt;P&gt;Nice. I didn't know this feature.&lt;/P&gt;</description>
    <pubDate>Thu, 21 Nov 2024 13:21:47 GMT</pubDate>
    <dc:creator>lucassilveira</dc:creator>
    <dc:date>2024-11-21T13:21:47Z</dc:date>
    <item>
      <title>Is there a reverse command of fieldsFlatten?</title>
      <link>https://community.dynatrace.com/t5/DQL/Is-there-a-reverse-command-of-fieldsFlatten/m-p/260028#M1351</link>
      <description>&lt;P&gt;I would like to make a json from some log attributes. Is this possible?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 14:45:55 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Is-there-a-reverse-command-of-fieldsFlatten/m-p/260028#M1351</guid>
      <dc:creator>lucassilveira</dc:creator>
      <dc:date>2024-10-21T14:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a reverse command of fieldsFlatten?</title>
      <link>https://community.dynatrace.com/t5/DQL/Is-there-a-reverse-command-of-fieldsFlatten/m-p/260049#M1353</link>
      <description>&lt;P&gt;Yes, if you can enumerate them.&amp;nbsp;Let's assume you have following demo data:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_0-1729526955878.png" style="width: 560px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/23919iBBBE0A74C0E1B033/image-dimensions/560x205?v=v2" width="560" height="205" role="button" title="krzysztof_hoja_0-1729526955878.png" alt="krzysztof_hoja_0-1729526955878.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You can build object (complex record) using &lt;EM&gt;&lt;STRONG&gt;record&lt;/STRONG&gt; &lt;/EM&gt;function:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_1-1729527017011.png" style="width: 689px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/23920iCB8EE2B3923165EA/image-dimensions/689x331?v=v2" width="689" height="331" role="button" title="krzysztof_hoja_1-1729527017011.png" alt="krzysztof_hoja_1-1729527017011.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is my query for easy reuse:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;data json:"""[{"a":1,"b":"x"},{"a":2,"b":"y"}]"""
| fieldsAdd j = record(a,b)
| fieldsAdd js = toString(j)&lt;/LI-CODE&gt;&lt;P&gt;I hope it helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 16:11:29 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Is-there-a-reverse-command-of-fieldsFlatten/m-p/260049#M1353</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2024-10-21T16:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a reverse command of fieldsFlatten?</title>
      <link>https://community.dynatrace.com/t5/DQL/Is-there-a-reverse-command-of-fieldsFlatten/m-p/260088#M1354</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/82169"&gt;@lucassilveira&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you mention sample log line to give you the proper transformation method?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2024 06:11:06 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Is-there-a-reverse-command-of-fieldsFlatten/m-p/260088#M1354</guid>
      <dc:creator>MostafaHussein</dc:creator>
      <dc:date>2024-10-22T06:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a reverse command of fieldsFlatten?</title>
      <link>https://community.dynatrace.com/t5/DQL/Is-there-a-reverse-command-of-fieldsFlatten/m-p/260097#M1355</link>
      <description>&lt;P&gt;In addition to what&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/25373"&gt;@krzysztof_hoja&lt;/a&gt;&amp;nbsp;mentioned, you can use Key-Value Pairs (KVPs) as outlined in the documentation: &lt;A href="https://docs.dynatrace.com/docs/shortlink/dpl-key-value-pairs" target="_self"&gt;Key-Value Pairs.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In a log processing rule, you can use the KVP operator to transform the necessary key-value pairs into JSON.&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;PARSE(content,"'[' JSONTIMESTAMP:timestamp '] ' KVP{'['[^[:]*:key ': ' DATA:value '] '}:kvp '[[' DATA:message ']]'")&lt;BR /&gt;|FIELDS_ADD(loglevel:kvp[LOGLEVEL])&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2024 06:40:45 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Is-there-a-reverse-command-of-fieldsFlatten/m-p/260097#M1355</guid>
      <dc:creator>Mohamed_Hamdy</dc:creator>
      <dc:date>2024-10-22T06:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a reverse command of fieldsFlatten?</title>
      <link>https://community.dynatrace.com/t5/DQL/Is-there-a-reverse-command-of-fieldsFlatten/m-p/263192#M1465</link>
      <description>&lt;P&gt;Perfect, thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2024 12:34:30 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Is-there-a-reverse-command-of-fieldsFlatten/m-p/263192#M1465</guid>
      <dc:creator>lucassilveira</dc:creator>
      <dc:date>2024-11-21T12:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a reverse command of fieldsFlatten?</title>
      <link>https://community.dynatrace.com/t5/DQL/Is-there-a-reverse-command-of-fieldsFlatten/m-p/263213#M1466</link>
      <description>&lt;P&gt;Nice. I didn't know this feature.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2024 13:21:47 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Is-there-a-reverse-command-of-fieldsFlatten/m-p/263213#M1466</guid>
      <dc:creator>lucassilveira</dc:creator>
      <dc:date>2024-11-21T13:21:47Z</dc:date>
    </item>
  </channel>
</rss>

