Forum Discussion
Existing queries in Application Insights don't work in OMS
Hi,
I haven't used the connector myself, but indeed the data structure is not equivalent to that used in Application Insights. Summarizng the data should still be possible, using other operators.
What exactly would you like to calculate?
- Kok San LeeSep 03, 2017Copper Contributor
Hi,
For example, let custom event be:track_event('test_drive', {"brand": "foo", "make": "bar"})Somthing I do in Application Insights is a query like such:
customEvents | where name == 'test_drive' | summarize by count() by tostring(customDimensions.brand)
where I do a count of a specific custom event summarized over a field I created for that event.
- Noa KuperbergSep 04, 2017
Microsoft
There are several ways, here are examples for parse and extract:
parse ('"firstname": "John", "lastname": "Doe"') with '"firstname": "' firstname '", "lastname": "' lastname '"' | project firstname, lastname...| extend custom_value='"firstname": "John", "lastname": "Doe"' | extend names = extractall('"firstname": "(.*)", "lastname": "(.*)"', custom_value) | project custom_value, firstname=names[0][0], lastname=names[0][1]
over these you eventually summarize as you prefer.- Ketan GhelaniSep 10, 2017Former Employee
Just to give you some history. App Insights Connector was created when OMS didn't support json so we had to transform these. In the near future, the need for connector will go away and you should be able to query data directly for e.g. app('foo').events | take 100.