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 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则