We have the following architecture configured:
Our issue:
At the back-end application we are trying to filter events by device ID. Here is the tricky thing. If the device ID is present in the telemetry, filtering is easy. However, what predicate should we use to filter on device ID when it is not present in the telemetry. Azure documentation defines only two built-in properties ($esn
and $ts
), but we can clearly see that in the response values, one of the values is the Device ID. But what is the name of the property so that we can include it in a query predicate?
Thank you!
I am able to query on the Iot Hub device ID by using a predicate on the property iothub-connection-device-id
. See my JSON for reference
{
"searchSpan": {
"from": "2018-08-02T08:00:00.000Z",
"to": "2018-08-02T15:00:00.000Z"
},
"predicate" : {
"eq": {
"left": {
"property": "iothub-connection-device-id",
"type": "String"
},
"right": "my-sample-device"
}
},
"top" : {
"sort": [{
"input" : {
"builtInProperty" : "$ts"
},
"order" : "Asc"
}],
"count" : 10
}
}