<?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 Processing Rule with Brackets in JSON in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/DQL-Processing-Rule-with-Brackets-in-JSON/m-p/248047#M973</link>
    <description>&lt;P&gt;Thanks &lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/13072"&gt;@mark_bley&lt;/a&gt; !!!!!! Just to understand that [0] is the index of the attribute inside the array? if I need to recover something inside second level of nested retrievalData? I cannot found those examples in the &lt;A href="https://docs.dynatrace.com/docs/shortlink/lma-log-processing-examples" target="_blank"&gt;doc&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Tue, 11 Jun 2024 19:54:58 GMT</pubDate>
    <dc:creator>DanielS</dc:creator>
    <dc:date>2024-06-11T19:54:58Z</dc:date>
    <item>
      <title>DQL Processing Rule with Brackets in JSON</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-Processing-Rule-with-Brackets-in-JSON/m-p/248026#M970</link>
      <description>&lt;P&gt;Hello Community,&lt;/P&gt;&lt;P&gt;I have this DQL Processing issue:&lt;/P&gt;&lt;P&gt;For this log&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
"event.type": "LOG",
"content": "{\"clientId\":\"35edd03e-84cd-4c7b-831d-e8318fbcfc06\",\"context\":\"ValidationService\",\"extras\":{\"errorCode\":\"PART_OF_DOCUMENT_MISSING\",\"retrievalData\":{\"capability\":\"usability\",\"data\":{},\"reason\":\"PART_OF_DOCUMENT_MISSING\",\"status\":\"REJECTED\"}},\"level\":\"info\",\"message\":\"Validation failed\",\"timestamp\":\"2024-06-11T14:00:05.649Z\",\"traceId\":\"97f9b7bd-a9ff-4c3d-8494-f28171e74bff\"}",
"status": "NONE",
"timestamp": "1718114405649"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I have this processing rule:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;PARSE(content, "
JSON{
  STRING:clientId,
  JSON {STRING:errorCode}:extras
}:parsedJson")
| FIELDS_ADD(top_level.attribute1: parsedJson["clientId"], top_level.attribute2: parsedJson["extras"]["errorCode"])
| FIELDS_REMOVE(parsedJson)&lt;/LI-CODE&gt;&lt;P&gt;and my output is :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  "top_level.attribute1": "35edd03e-84cd-4c7b-831d-e8318fbcfc06",
  "top_level.attribute2": "PART_OF_DOCUMENT_MISSING",&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Great, but this is only to probe that the rule is working, the original log has brackets in the nested extras:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
"event.type": "LOG",
"content": "{\"clientId\":\"35edd03e-84cd-4c7b-831d-e8318fbcfc06\",\"context\":\"ValidationService\",\"extras\":[{\"errorCode\":\"PART_OF_DOCUMENT_MISSING\",\"retrievalData\":{\"capability\":\"usability\",\"data\":{},\"reason\":\"PART_OF_DOCUMENT_MISSING\",\"status\":\"REJECTED\"}}],\"level\":\"info\",\"message\":\"Validation failed\",\"timestamp\":\"2024-06-11T14:00:05.649Z\",\"traceId\":\"97f9b7bd-a9ff-4c3d-8494-f28171e74bff\"}",
"status": "NONE",
"timestamp": "1718114405649"
}&lt;/LI-CODE&gt;&lt;P&gt;and with this brackets the parse won't work, how can I&amp;nbsp; modify the processing rule to retrieve the nested errorCode field?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 16:24:36 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-Processing-Rule-with-Brackets-in-JSON/m-p/248026#M970</guid>
      <dc:creator>DanielS</dc:creator>
      <dc:date>2024-06-11T16:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: DQL Processing Rule with Brackets in JSON</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-Processing-Rule-with-Brackets-in-JSON/m-p/248042#M972</link>
      <description>&lt;P&gt;That is a json array try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;PARSE(content, "
JSON{
  STRING:clientId,
  JSON_ARRAY { JSON }:extras
}:parsedJson")
| FIELDS_ADD(top_level.attribute1: parsedJson["clientId"], top_level.attribute2: parsedJson["extras"][0]["errorCode"])
| FIELDS_REMOVE(parsedJson)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 11 Jun 2024 19:12:55 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-Processing-Rule-with-Brackets-in-JSON/m-p/248042#M972</guid>
      <dc:creator>mark_bley</dc:creator>
      <dc:date>2024-06-11T19:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: DQL Processing Rule with Brackets in JSON</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-Processing-Rule-with-Brackets-in-JSON/m-p/248047#M973</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/13072"&gt;@mark_bley&lt;/a&gt; !!!!!! Just to understand that [0] is the index of the attribute inside the array? if I need to recover something inside second level of nested retrievalData? I cannot found those examples in the &lt;A href="https://docs.dynatrace.com/docs/shortlink/lma-log-processing-examples" target="_blank"&gt;doc&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 19:54:58 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-Processing-Rule-with-Brackets-in-JSON/m-p/248047#M973</guid>
      <dc:creator>DanielS</dc:creator>
      <dc:date>2024-06-11T19:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: DQL Processing Rule with Brackets in JSON</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-Processing-Rule-with-Brackets-in-JSON/m-p/248085#M975</link>
      <description>&lt;OL&gt;&lt;LI&gt;Correct&lt;/LI&gt;&lt;LI&gt;Use either an index or key, depending on the type of object you access&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;You can find more detailed info regarding DPL here&amp;nbsp;&lt;A href="https://docs.dynatrace.com/docs/shortlink/dpl-json-arrays" target="_blank"&gt;https://docs.dynatrace.com/docs/shortlink/dpl-json-arrays&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 07:11:45 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-Processing-Rule-with-Brackets-in-JSON/m-p/248085#M975</guid>
      <dc:creator>mark_bley</dc:creator>
      <dc:date>2024-06-12T07:11:45Z</dc:date>
    </item>
  </channel>
</rss>

