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.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인