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
demandé il y a 3 ans279 vues
1 réponse
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
répondu il y a 3 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions