cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Transform String to JSON

nicoe_welch
Dynatrace Participant
Dynatrace Participant

Hey team how would I convert a "content" string field into JSON object? The Content field is a "stringified" JSON object, is there a DQL command that would convert this into a JSON object. stdout F preludes the JSON object which is what I believe is causing Dynatrace to see this content field as a string and not JSON. For comparison here is another log event structured as pure JSONScreenshot_2.png

1 REPLY 1

sinisa_zubic
Dynatrace Champion
Dynatrace Champion

Hi @nicoe_welch 

You can try if this DQL query works

fetch logs
| parse content, "DATA json:json"
| fieldsAdd appId = json[appId], level = json[level]

Basically you need to parse the content and extract the json information from the content. With using the fieldsAdd command you can add nested json fields to be visible on top level.

 

Best,
Sini

Featured Posts