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

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ