ms app analytics - Application Insights Extract Nested CustomDimensions -


i have data in application insights analytics has dynamic object property of custom dimensions. example:

|        timestamp        |  name   | customdimensions                 | etc | |-------------------------|---------|----------------------------------|-----| | 2017-09-11t19:56:20.000 | spinner | {                                | ... |                                          mycustomdimension: "hi"                                          properties:                                              context: "abc"                                              usermessage: "some other"                                       } 

does make sense? key/value pair inside of customdimensions.

i'm trying bring context property proper column in results. expected :

|        timestamp        |  name   | customdimensions                 | context| etc | |-------------------------|---------|----------------------------------|--------|-----| | 2017-09-11t19:56:20.000 | spinner | {                                | abc    | ...                                          mycustomdimension: "hi"                                          properties:                                              context: "abc"                                              usermessage: "some other"                                       } 

i've tried this:

customevents | name == "spinner" | extend context = customdimensions.properties["context"] 

and this:

customevents | name == "spinner"  | extend context = customdimensions.properties.context 

but neither seem work. give me column @ end named "context" column empty - no values.

any ideas?

edit:

added picture clarifying format of data:

application insights data

edited working answer:

customevents  | name == "spinner"  | extend properties = todynamic(tostring(customdimensions.properties))  | extend context = properties.context 

you need tostring , todynamic in here expect (and i expected!)

the explanation given:

dynamic field "promises" upper/outer level of key / value access (this how access customdimensions.properties).

accessing internal structure of json depends on exact format of customdimensions.properties content. doesn’t have json itself. if looks structured json, still may string not formatted json.

so basically, default won't attempt parse strings inside of dynamic/json block because don't want spend lot of time possibly trying , failing convert nested content json infinitely.

i still think extra tostring shouldn't required inside there, since todynamic should allowing both string , dynamic in validly, i'm checking see if team owns query stuff can make step better.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -