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

Parse JSON array

stefan_eggersto
Dynatrace Mentor
Dynatrace Mentor
Hi all, is it possible in DQL to parse a JSON string that contains an array on the top level?
I can parse a top-level JSON object like 
data record(value = "{\"hello\" : \"world\"}")
| parse value, "JSON:json"
stefan_eggersto_0-1685541605234.png

 

But I fail to parse a top-level JSON array:

data record(value = "[{\"hello\" : \"world\"}]")
| parse value, "JSON:json"
stefan_eggersto_1-1685541634574.png

 

 
1 REPLY 1

educampver
Dynatrace Advisor
Dynatrace Advisor

Hi Stefan, you have to use JSON_ARRAY for that:

 

data record(value = "[{\"hello\" : \"world\"}]")
| parse value, "JSON_ARRAY:greeting"
| fields greeting

 

Featured Posts