0

I would like to use the variable settingName for the dynamic json property. How can i accomplish that?

let settingName = 'LaunchNext';

DSEvents
| where  Timestamp > ago(1d) and Data contains (settingName)
| summarize count() by tostring(parsejson(tostring(Data.Settings)).LaunchNext.value)

I want to substitute the variable instead of the actual property

parsejson(tostring(Data.Settings)).LaunchNext.value

Praveen Reddy
  • 7,295
  • 2
  • 21
  • 43

1 Answers1

0

Enclosing the variable in [] worked for me

tostring(parsejson(tostring(Data.Settings)).[settingName].value)
Praveen Reddy
  • 7,295
  • 2
  • 21
  • 43