12 Aug 2024 01:49 PM
Good afternoon community,
in my log line I have a field called:
custom_headers
custom headers contains this value:
{"id":"261004620","name":"OrderId","value":"5602867201"},
{"id":"260996569","name":"xxxxother","value":"xxxxxx"}
out of all of it I'd like to extract and keep:
OrderId as the name of the column and then each row to be the actual id ("value":"56xxxxx")
Reviewed DPL/DQL but things are quite complex,
thanks for any help here,
regards,
Yann
Solved! Go to Solution.
13 Aug 2024 02:56 PM
Thanks to internal Dynatrace help I was able to solve this.
The new Processor worked like this:
parse custom_headers[0],"JSON:temp1"
|parse custom_headers[1],"JSON:temp2"
|fieldsAdd SalesOrderId = if(temp1[name] == "SalesOrderId",temp1[value],else:temp2[value])
The two first line defines separate Json from the whole array (the one in position [0] and the on in [1]).
The last line adds a field called SalesOrderID and the value will match temp1[value] if temp1[name] == "SalesOrderId" or will match temp2[value] if temp1[name] will not be"SalesOrderId".
Regards