跳至內容

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

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。