Syntax to filter device data and define actions - AWS IoT Events

Syntax to filter device data and define actions

You can use literals, operators, functions, references, and substitution templates in the AWS IoT Events expressions.

Literals

  • Integer

  • Decimal

  • String

  • Boolean

Operators

Unary
  • Not (Boolean): !

  • Not (bitwise): ~

  • Minus (arithmetic): -

String
  • Concatenation: +

    Both operands must be strings. String literals must be enclosed in single quotes (').

    For example: 'my' + 'string' -> 'mystring'

Arithmetic
  • Addition: +

    Both operands must be numeric.

  • Subtraction: -

  • Division: /

    The result of the division is a rounded integer value unless at least one of the operands (divisor or dividend) is a decimal value.

  • Multiplication: *

Bitwise (Integer)
  • OR: |

    For example: 13 | 5 -> 13

  • AND: &

    For example: 13 & 5 -> 5

  • XOR: ^

    For example: 13 ^ 5 -> 8

  • NOT: ~

    For example: ~13 -> -14

Boolean
  • Less Than: <

  • Less Than Or Equal To: <=

  • Equal To: ==

  • Not Equal To: !=

  • Greater Than Or Equal To: >=

  • Greater Than: >

  • AND: &&

  • OR: ||

    Note

    When a subexpression of || contains undefined data, that subexpression is treated as false.

Parentheses

You can use parentheses to group terms within an expression.