Saltar al contenido

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 ?

preguntada hace 2 años95 visualizaciones

1 Respuesta
2
Respuesta aceptada

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 hace 2 años

EXPERTO

revisado hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.