Skip to content

AWS::IoT::TopicRule - How to simply check if a field is present?

0

Imagine I'm receving messages like this

{
  "Id": "ecc-AABBCCDDEE",
  "CmdRef": "ZZZZ-YYYY",
  "HostId": "ABCDEF0123",
  "GetSchedEventRequest": [
    {
      "St": "2024/07/14 08:16",
      "Dr": 60,
      "Ty": 0,
      "Rb": 16,
      "En": 1
    }
  ]
}

I need to create an AWS::IoT::TopicRule where SQL is allowing pass for each messages which contains GetSchedEventRequest. Is there a SQL syntax available ?

asked 2 years ago94 views
1 Answer
2
Accepted Answer

I found

Sql: "SELECT * FROM 'ef/d/#' WHERE IsUndefined(GetSchedEventRequest) = False"

But, important, you must set

AwsIotSqlVersion: "2016-03-23"

because the default version is older and is NOT compatible with this syntax.

answered 2 years ago
EXPERT
reviewed 2 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.