Lloyd Colart
Lloyd Colart

Reputation: 41

Stream Analytics Job to blob don't close my json array

I have a problem with my Stream Analytic job in azure. I've got inputs from my IotHub and I want to output these into a blob container.

This is an input preview from IotHub to Stream Analytic job:

[{ "deviceName": "Environnement-Pearson-Vue", "devEUI": "70B3D547501000B5", "devType": "LoRaWAN", "container": "presence", "value": "47833", "EventProcessedUtcTime": "2021-08-16T11:46:32.8157342Z", "PartitionId": 0, "EventEnqueuedUtcTime": "2021-08-16T11:38:13.3010000Z" }, { "deviceName": "Environnement-Pearson-Vue", "devEUI": "70B3D547501000B5", "devType": "LoRaWAN", "container": "luminosity", "value": "134", "EventProcessedUtcTime": "2021-08-16T11:46:32.8157342Z", "PartitionId": 0, "EventEnqueuedUtcTime": "2021-08-16T11:38:12.1130000Z" }, { "deviceName": "Environnement-Toilets", "devEUI": "70B3D547501000BD", "devType": "LoRaWAN", "container": "temperature", "value": "21.12", "EventProcessedUtcTime": "2021-08-16T11:46:31.2930477Z", "PartitionId": 0, "EventEnqueuedUtcTime": "2021-08-16T10:48:39.7440000Z" }, { "deviceName": "Environnement-OpenSpace-South_Central", "devEUI": "70B3D54750100260", "devType": "LoRaWAN", "container": "presence", "value": "37965", "EventProcessedUtcTime": "2021-08-16T11:46:31.2930477Z", "PartitionId": 1, "EventEnqueuedUtcTime": "2021-08-16T10:47:31.3160000Z" }, { "deviceName": "Environnement-OpenSpace-South_Central", "devEUI": "70B3D54750100260", "devType": "LoRaWAN", "container": "luminosity", "value": "217", "EventProcessedUtcTime": "2021-08-16T11:46:31.2930477Z", "PartitionId": 1, "EventEnqueuedUtcTime": "2021-08-16T10:47:30.0030000Z" }, { "deviceName": "Environnement-OpenSpace-South_Central", "devEUI": "70B3D54750100260", "devType": "LoRaWAN", "container": "humidity", "value": "43", "EventProcessedUtcTime": "2021-08-16T11:46:31.2930477Z", "PartitionId": 1, "EventEnqueuedUtcTime": "2021-08-16T10:47:28.7060000Z" }, { "deviceName": "Environnement-OpenSpace-South_Central", "devEUI": "70B3D54750100260", "devType": "LoRaWAN", "container": "temperature", "value": "27.09", "EventProcessedUtcTime": "2021-08-16T11:46:31.2930477Z", "PartitionId": 1, "EventEnqueuedUtcTime": "2021-08-16T10:47:27.5030000Z" }, { "deviceName": "Environnement-OpenSpace-South_East", "devEUI": "70B3D54750100263", "devType": "LoRaWAN", "container": "presence", "value": "23793", "EventProcessedUtcTime": "2021-08-16T11:46:31.2930477Z", "PartitionId": 3, "EventEnqueuedUtcTime": "2021-08-16T10:47:20.3800000Z" }, { "deviceName": "Environnement-OpenSpace-South_East", "devEUI": "70B3D54750100263", "devType": "LoRaWAN", "container": "luminosity", "value": "267", "EventProcessedUtcTime": "2021-08-16T11:46:31.2930477Z", "PartitionId": 3, "EventEnqueuedUtcTime": "2021-08-16T10:47:19.5050000Z" }, { "deviceName": "Environnement-OpenSpace-South_East", "devEUI": "70B3D54750100263", "devType": "LoRaWAN", "container": "humidity", "value": "45", "EventProcessedUtcTime": "2021-08-16T11:46:31.2930477Z", "PartitionId": 3, "EventEnqueuedUtcTime": "2021-08-16T10:47:18.1990000Z" }, { "deviceName": "Environnement-OpenSpace-South_East", "devEUI": "70B3D54750100263", "devType": "LoRaWAN", "container": "temperature", "value": "27.34", "EventProcessedUtcTime": "2021-08-16T11:46:31.2930477Z", "PartitionId": 3, "EventEnqueuedUtcTime": "2021-08-16T10:47:17.6050000Z" } ]

This is my output configuration:

OutputDetails

In my blob container, I receive the json, but the ] at the end of the array is missing.

[{"deviceName":"Environnement-OpenSpace-South_East","devEUI":"70B3D54750100263","devType":"LoRaWAN","container":"temperature","value":"27.34","EventProcessedUtcTime":"2021-08-16T10:27:16.9891741Z","PartitionId":3,"EventEnqueuedUtcTime":"2021-08-16T10:27:16.8240000Z"},{"deviceName":"Environnement-OpenSpace-South_East","devEUI":"70B3D54750100263","devType":"LoRaWAN","container":"humidity","value":"45.5","EventProcessedUtcTime":"2021-08-16T10:27:17.7548394Z","PartitionId":3,"EventEnqueuedUtcTime":"2021-08-16T10:27:17.6080000Z"},{"deviceName":"Environnement-OpenSpace-South_East","devEUI":"70B3D54750100263","devType":"LoRaWAN","container":"luminosity","value":"267","EventProcessedUtcTime":"2021-08-16T10:27:19.3798447Z","PartitionId":3,"EventEnqueuedUtcTime":"2021-08-16T10:27:19.2170000Z"},{"deviceName":"Environnement-OpenSpace-South_East","devEUI":"70B3D54750100263","devType":"LoRaWAN","container":"presence","value":"23793","EventProcessedUtcTime":"2021-08-16T10:27:20.6940573Z","PartitionId":3,"EventEnqueuedUtcTime":"2021-08-16T10:27:20.4980000Z"},{"deviceName":"Environnement-OpenSpace-South_East","devEUI":"70B3D54750100263","devType":"LoRaWAN","container":"temperature","value":"27.34","EventProcessedUtcTime":"2021-08-16T10:47:17.7504276Z","PartitionId":3,"EventEnqueuedUtcTime":"2021-08-16T10:47:17.6050000Z"},{"deviceName":"Environnement-OpenSpace-South_East","devEUI":"70B3D54750100263","devType":"LoRaWAN","container":"humidity","value":"45","EventProcessedUtcTime":"2021-08-16T10:47:18.2972219Z","PartitionId":3,"EventEnqueuedUtcTime":"2021-08-16T10:47:18.1990000Z"},{"deviceName":"Environnement-OpenSpace-South_East","devEUI":"70B3D54750100263","devType":"LoRaWAN","container":"luminosity","value":"267","EventProcessedUtcTime":"2021-08-16T10:47:19.6069523Z","PartitionId":3,"EventEnqueuedUtcTime":"2021-08-16T10:47:19.5050000Z"},{"deviceName":"Environnement-OpenSpace-South_East","devEUI":"70B3D54750100263","devType":"LoRaWAN","container":"presence","value":"23793","EventProcessedUtcTime":"2021-08-16T10:47:20.5947042Z","PartitionId":3,"EventEnqueuedUtcTime":"2021-08-16T10:47:20.3800000Z"},{"deviceName":"Environnement-OpenSpace-South_East","devEUI":"70B3D54750100263","devType":"LoRaWAN","container":"temperature","value":"27.34","EventProcessedUtcTime":"2021-08-16T11:07:17.0348875Z","PartitionId":3,"EventEnqueuedUtcTime":"2021-08-16T11:07:16.8800000Z"},{"deviceName":"Environnement-OpenSpace-South_East","devEUI":"70B3D54750100263","devType":"LoRaWAN","container":"humidity","value":"44","EventProcessedUtcTime":"2021-08-16T11:07:18.0192599Z","PartitionId":3,"EventEnqueuedUtcTime":"2021-08-16T11:07:17.8810000Z"},{"deviceName":"Environnement-OpenSpace-South_East","devEUI":"70B3D54750100263","devType":"LoRaWAN","container":"luminosity","value":"300","EventProcessedUtcTime":"2021-08-16T11:07:19.4400515Z","PartitionId":3,"EventEnqueuedUtcTime":"2021-08-16T11:07:19.2090000Z"},{"deviceName":"Environnement-OpenSpace-South_East","devEUI":"70B3D54750100263","devType":"LoRaWAN","container":"presence","value":"23793","EventProcessedUtcTime":"2021-08-16T11:07:20.4257254Z","PartitionId":3,"EventEnqueuedUtcTime":"2021-08-16T11:07:20.3810000Z"},{"deviceName":"Environnement-OpenSpace-South_East","devEUI":"70B3D54750100263","devType":"LoRaWAN","container":"battery","value":"100","EventProcessedUtcTime":"2021-08-16T11:07:26.6757684Z","PartitionId":3,"EventEnqueuedUtcTime":"2021-08-16T11:07:26.5220000Z"},{"battery":"100","EventProcessedUtcTime":"2021-08-16T11:07:27.2221725Z","PartitionId":3,"EventEnqueuedUtcTime":"2021-08-16T11:07:26.9760000Z"},{"deviceName":"Environnement-OpenSpace-South_East","devEUI":"70B3D54750100263","devType":"LoRaWAN","container":"temperature","value":"27.34","EventProcessedUtcTime":"2021-08-16T11:27:17.5267324Z","PartitionId":3,"EventEnqueuedUtcTime":"2021-08-16T11:27:17.3980000Z"},{"deviceName":"Environnement-OpenSpace-South_East","devEUI":"70B3D54750100263","devType":"LoRaWAN","container":"humidity","value":"42.5","EventProcessedUtcTime":"2021-08-16T11:27:18.1846773Z","PartitionId":3,"EventEnqueuedUtcTime":"2021-08-16T11:27:17.9610000Z"},{"deviceName":"Environnement-OpenSpace-South_East","devEUI":"70B3D54750100263","devType":"LoRaWAN","container":"luminosity","value":"200","EventProcessedUtcTime":"2021-08-16T11:27:19.3851440Z","PartitionId":3,"EventEnqueuedUtcTime":"2021-08-16T11:27:19.2580000Z"},{"deviceName":"Environnement-OpenSpace-South_East","devEUI":"70B3D54750100263","devType":"LoRaWAN","container":"presence","value":"23794","EventProcessedUtcTime":"2021-08-16T11:27:21.0287823Z","PartitionId":3,"EventEnqueuedUtcTime":"2021-08-16T11:27:20.8690000Z"}

Any issues to fix this? Thx

Upvotes: 1

Views: 83

Answers (1)

Lloyd Colart
Lloyd Colart

Reputation: 41

After search, I find that the closing bracket is added when you move the next hour. The file from the previous hour is closed and a file for the current hour is created. If your aggregation is not hourly but daily, the behavior will be seen at the day’s end.

Upvotes: 3

Related Questions