Gib80
October 4, 2024, 11:34am
1
Summary: This thread shows how to parse string data into array structures in DQL. It includes examples of splitting fields and working with the resulting array elements.
Good Afternoon,
Is it possible to convert a string from a parsed command to an array?
This is the parsed command I have.
| parse event.original, “”“LD 'watchlist”:’ LD:Watchlist ‘,’ “”"
I wish to use the sort command below, but it states that watchlist is a string, not an array.
| sort arraySum(Watchlist) desc
Kind regards
Yes, it is possible and there are many option. Depending on how this array is represented in string, you can use:
or DPL JSON Data — Dynatrace Docs
or DPL Array — Dynatrace Docs
To advice more precisely example of original filed value would be helpful.
Gib80
October 7, 2024, 7:14am
3
Hi krzysztof_hoja,
The filed value returned from the watchlist parsed command above is “S_PEP”
Kind regards
Preview
If it is “S_PEP” (not a number), how do you want to calculate “arraySum(Watchlist)” ?
Or maybe you want to order records alphabetically (| sort Watchlist) ?