Search code examples
azurekqltelemetry

Is customDimension column name 'first' restricted?


Query could not be parsed at 'first' on line

All other columns are able to be parsed with no issue, does KQL custom dimensions restrict the use of the column name 'first' when trying to parse?

Here is the query that isn't working:

extend f =  tostring(parse_json(tostring(customDimensions.first)))

Solution

  • Is customDimension column name 'first' restricted?

    No customDimension column name 'first' is not restricted. As the first is a column name, try by mentioning it in quotes 'first' and it works successfully as shown in the below output.

    let sampleData = datatable(customDimensions: dynamic)
    [
        dynamic({"first": "John", "last": "Doe", "age": 30}),
        dynamic({"first": "Jane", "last": "Smith", "age": 25})
    ];
    sampleData
    | extend firstName = tostring(parse_json(tostring(customDimensions['first'])))
    | project firstName
    

    Output: enter image description here