跳至内容

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 ?

已提问 2 年前95 查看次数

1 回答
2
已接受的回答

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.

已回答 2 年前

专家

已审核 2 年前

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

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