integrating IoT topic incoming JSON array of measurments with timestream


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" }]]

posta 2 anni fa526 visualizzazioni
1 Risposta

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").

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.

con risposta 2 anni fa
  • 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.

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande