number

Checks the contents of a message parsed as a 64-bit floating point number against a logical operator and an argument.

number:
operator: equals
arg: 0

This condition is useful when paired with the check_field and check_interpolation conditions to check a number condition against arbitrary metadata or fields of messages.

Fields

operator

string An operator to apply.

arg

number An argument to check against. For some operators this field not be required.

part

number The index of a message within a batch to test the condition against. This field is only applicable when batching messages at the input level.

Indexes can be negative, and if so the part will be selected from the end counting backwards starting from -1.

Operators

equals

Checks whether the value equals the argument.

greater_than

Checks whether the value is greater than the argument. Returns false if the value cannot be parsed as a number.

less_than

Checks whether the value is less than the argument. Returns false if the value cannot be parsed as a number.

Examples

You can test a number condition against the size of a message batch with:

check_interpolation:
value: ${!batch_size}
condition:
number:
operator: greater_than
arg: 1