integrating IoT topic incoming JSON array of measurments with timestream

0

Hi, I am trying to integrate IoT rule with timestream. I managed to handle a case when I have one incoming measurement per messages, but for network optimisation (or something) we receive packed measurements as JSON array (examples below). Is there a way to compose SQL code which will parse incoming array and put multiple measurements into timestream db?

Single measurement example:

{ "value": 335, "dataId": "Wroclaw1" "takenAt": "2022-02-01T11:40:46.770Z" }

my case:

[[{ "value": 35, "dataId": "Wroclaw1" "takenAt": "2022-02-01T11:40:46.770Z" }, { "value": 37, "dataId": "Wroclaw2" "takenAt": "2022-02-01T11:41:49.260Z" }]]

已提問 2 年前檢視次數 475 次
1 個回答
0

Hi kaczkaikielbasa!

I am not sure if you can use SQL to access a Timestream - as for the documentation below, you can use API or AWS SDKs to do that (chapter "Accessing Timestream").

https://docs.aws.amazon.com/timestream/latest/developerguide/what-is-timestream.html

Depending on the amount and frequency of the data, you could try testing parsing using the language of your choice from available AWS SDKs and put that on the AWS Lambda (just to try it out, later on - in production - you would probably go for the EC2 or microservices).

Please check out the code samples that are available in the documentation as well.

已回答 2 年前
  • not the issue I was asking about. I am not accessing timestream with SQL. I want AWS IoT rule SQL to parse incoming JSON array to pass measurements to timestream. It is possible with single measurement data.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南