Ir para o conteúdo

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 ?

feita há 2 anos95 visualizações

1 Resposta
2
Resposta aceita

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.

respondido há 2 anos

ESPECIALISTA

avaliado há 2 anos

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.