Forum Discussion
sarfrazkhs
Mar 30, 2020Copper Contributor
Log Analytics with IOTHUb
Hi Members, I am in the process of fetching the distinct devices which are sending the data from log analytics but not quite getting the query to work as I know some syntax I am missing it....
CliveWatson
Mar 30, 2020Former Employee
AzureDiagnostics
| where ResourceType == "IOTHUBS"
| distinct _ResourceId
Replace _ResourceId with a working column
sarfrazkhs
Mar 31, 2020Copper Contributor
Thanks CliveWatson
I used the query as per the one but would like to know how can I get deviceId in the query.
AzureDiagnostics
| where ResourceType == "IOTHUBS"
| distinct properties_s
- CliveWatsonMar 31, 2020Former Employee
I don't have that data, but these are a near example:
AzureActivity | extend clientRequestId_ = tostring(parse_json(HTTPRequest).clientRequestId) | distinct clientRequestId_ AzureActivity | extend clientRequestId_ = tostring(parse_json(HTTPRequest).clientRequestId) | summarize count() by clientRequestId_Go to Log Analytics and run query
You can press the "..." to extend the data into a column