Switch
3 min
the switch processor sends an incoming message to its output only when the message passes a rule you define why use switch use this processor to filter or route messages based on a field's value, for example, only forwarding a message when a status field equals a specific value, or routing different values to different downstream processors using output how it works set field name to the field to check, check value to the value to compare it against, and check value type to that value's expected data type rule determines how the comparison is made \== (equals) and != (not equals) the input value and check value must be equal, or different < (less than), <= (less than or equals), > (greater than), and >= (greater than or equals) standard numeric or lexicographic comparison is true and is false only applicable to fields with a bool data type is null passes only if the field isn't present in the input is not null passes only if the field is present in the input is of type compares the field's data type to check value type contains only applicable to fields with a string or json data type for string comparisons, the processor uses go's strings compare function, so strings are compared lexicographically (by character order) rather than by their numeric value use output to restrict where the result is published leave it empty to publish to every connected processor parameters parameter details rule the condition to check, for example, equals or not equals field name the field in the input message to check check value the value to compare field name against check value type the expected data type of check value output (optional) restricts where the result is published leave empty to publish to every connected processor related topics use the switch processor function docid 8v bttpnscrbkjente9cw