Reputation: 1
I'm working with Microsoft azure Appinsights, and want to export Logs data to a CSV so I can analyze it with python. The problem is that there is one column named customDimensions, which is of dynamic type with a lot of important variables, which I want to have as separate columns. Furthermore, am I working with a lot of data, so I can't just hardcode the variables I want using 'extend', because every customDimensions value could consist of different variables.
I found online that using bag_unpack comes near the solution I want:
union customEvents, pageViews
| project customDimensions
| evaluate bag_unpack(customDimensions)
However, this outputs only the new columns, not additional to the already existing columns. But when I don't use the 'project customDimensions' line, I get the following error:
("evaluate bag_unpack(): the following error(s) occurred while evaluating the output schema: evaluate bag_unpack(): cannot add column named 'cloud_RoleName' as it already exists in expression source")
The question is: How do I query to get all the variables in customDimensions as additional columns, instead of having it as a dictionary in the dataframe like this:
Dataframe with nested data instead of separate columns
Upvotes: 0
Views: 3289
Reputation: 3017
It seems you're having a collision between bag_unpack() output and columns already existing in the source of bag_unpack(). Depending on what you end-goal is:
Upvotes: 1