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
asked 3 years ago271 views
1 Answer
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
answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions