IoT rule ingestion with dynamic measure names

0

Hi,

I have few problems with ingesting data into Timestream DB using IoT rule engine. My measurement data comes in few different data types from many sources with unique identifiers. Therefore, I can't just group the data under the same measure name.

To resolve this I planned to use a unique measurement identifier as measure_name, so each series could have its respective data type. However, since those identifiers are dynamic (not just "cpu_temp" or something common like that), I can't just add them in the SELECT clause of SQL rule engine. Also, to add more complexity, the timestamp I want to use is the one that comes in the MQTT message, rather than the one at the time of rule invocation. I have tried, but I can't filter out metadata attributes in SQL rule engine, so all attributes get written to DB.

So far I only see one solution, which is to have one measure_name for each possible data type and keep unique identifiers in dimensions.

Is there any better solution to this scenario?

Would it be possible to use the value from one attribute as the name for the outgoing result of the other attribute in SQL rule engine?

From:
{
SignalName: "UniqueSensorIdentifier",
Value: 12345.6789
}

To:

{
UniqueSensorIdentifier: 12345.6789
}

Thank you.

ayuzva
질문됨 3년 전279회 조회
1개 답변
0

For anybody with the same issue:

You can use:

SELECT Signal.* FROM topic

And just nest the reading in Signal in your incoming JSON.

Edited by: ayuzva on Jun 18, 2021 11:43 AM

ayuzva
답변함 3년 전

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

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

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