# Transform String to JSON

**URL:** <https://community.dynatrace.com/t/transform-string-to-json/42454>\
**Category:** DQL\
**Tags:** log-processing, grail\
**Created:** [November 3, 2023, 3:17pm UTC](https://community.dynatrace.com/t/transform-string-to-json/42454 "2023-11-03T15:17:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicoe\_welch](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/nicoe_welch/32/2452_2.png) [@nicoe\_welch](https://community.dynatrace.com/u/nicoe_welch)\
**Post date:** [November 3, 2023, 3:17pm UTC](https://community.dynatrace.com/t/transform-string-to-json/42454/1 "2023-11-03T15:17:13Z")

</div>

Hey team how would I convert a “content” string field into JSON object?&nbsp;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&nbsp;content field as a string and not JSON.&nbsp;For comparison here is another log event structured as pure JSON

 ![Screenshot_2.png](https://global.discourse-cdn.com/dynatrace/original/3X/e/9/e9e8be5710cded4262d78c111cd45003454cb387.jpeg)  
 ![Screenshot_1.jpg](https://global.discourse-cdn.com/dynatrace/original/3X/7/2/72142bf9e60df4036896ae7697880c930a48dbdd.jpeg)

---

<div class="post-metadata">

**Author:** ![sinisa\_zubic](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/sinisa_zubic/32/32498_2.png) [@sinisa\_zubic](https://community.dynatrace.com/u/sinisa_zubic)\
**Post date:** [November 3, 2023, 3:42pm UTC](https://community.dynatrace.com/t/transform-string-to-json/42454/2 "2023-11-03T15:42:58Z")

</div>

Hi&nbsp;[@nicoe\_welch](https://community.dynatrace.com/user/10367)

You can try if this DQL query works

```markup
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
