none
AppCenter Custom event Properties RRS feed

  • Question

  • Hi community,

    I'm stuck on something which i though would be easy, hoping someone can point out what i need to do! I've got AI Analytics for AppCenter hooked up to my iOS app, sending custom events successfully through. My custom events contain properties, which i also see coming through. But i can't work out how to pull them out to columns to then search/filter etc. Here's my base query:

    customEvents
    | where name == "APIManagement"
    | project timestamp, properties = customDimensions.["Properties"]
    | sort by timestamp desc 
    | extend 

    Properties are showing up in the  results, but i'm unable to extend them. How can i get them out to their own columns? When i try to use extend, or, use the "Extend Column" option on the properties (e.g. MethodName) i only get a blank column

    

    Thursday, February 13, 2020 10:28 PM

All replies

  • There are multiple ways to create a column with each property, you'd need to use "| extend column = " and then get to the desired JSON depth level with either "[]" notation, "." notation or parse_json function depending on the underlying data type in that field, e.g. | extend Response = customDimensions.Properties.ResponseCode for pure JSON, or for string value:

    T
    | extend d=parse_json(customDimensions["Properties"]) 
    | extend response=d.ResponseCode

    You may also want to check mv_expand and bag_unpack for more complex scenarios.


    Dmitry Matveev

    Friday, February 14, 2020 2:34 AM
    Owner
  • Thanks. I thought i had tried every combination of those, but finally i tried the option "Include" in the context menu, which generated this:

    parse_json(tostring(customDimensions.Properties)


    That's done the trick. For anyone with the same challenge, here's my final query:

    customEvents
    | sort by timestamp desc
    | extend properties = todynamic(parse_json(tostring(customDimensions.Properties)))
    | project timestamp, operation_Id, properties
    | evaluate bag_unpack(properties)

    Friday, February 14, 2020 11:52 AM