Why won't my IoT Core rule to timestream parse the data in a usable way?

0

So, I have data coming into IoT Core that looks like this. { "clientID": "AWSPGFIFBI", "topic": "ie/d/j/simatic/v1/s7c1/dp/r/Test1200/default", "protocol": "mqtt", "payload": { "seq": 367645, "vals": [ { "dataType": "", "id": "101", "name": "", "qc": 3, "ts": "2023-06-20T16:02:27.4078740Z", "val": 54 } ] } }

How would I go about get the nested data in the array to show up in Timestream for example the "val" or "id"?

Thanks

질문됨 일 년 전199회 조회
1개 답변
0

You can use the nested object queries to get the values. https://docs.aws.amazon.com/iot/latest/developerguide/iot-sql-nested-queries.html

In your example , use the below messaging routing rule to get the value of "id" and "val".

SELECT get(payload.vals,0).val AS VAL FROM 'TestRule'

SELECT get(payload.vals,0).id AS ID FROM 'TestRule'

I used "TestRule" as source generating the data.

AWS
답변함 일 년 전

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

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

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