Reputation: 1207
I'm using following code to send data to application insights
appInsights.trackEvent({
name:'EventName',
proprties:{'keys1':'value1' , 'key2':JSON.stringify({'nestedKey':'someValue'})}
});
when querying same in data explorer
customEvents
| extend key2_1 = parse_json(customDimensions.key2)
| extend key1_1 = tostring(customDimensions.key1)
| extend nestedKey1 = tostring(key2_1.nestedKey)
| extend nestedKey2 = tostring(customDimensions.key2.nestedKey)
both nestedKey1
and nestedKey2
are null , but both key1_1
and key2_1
has data
Upvotes: 4
Views: 528
Reputation: 29950
Just replace the 2 lines:
| extend nestedKey1 = tostring(key2_1.nestedKey)
| extend nestedKey2 = tostring(customDimensions.key2.nestedKey)
with the following 2 lines:
| extend nestedKey1 = parse_json(tostring(key2_1)).nestedKey
| extend nestedKey2 = parse_json(tostring(parse_json(customDimensions.key2))).nestedKey
Here is the test result at my side:
Upvotes: 1