Select Parts

Last updated: 1 minute read.

Cherry pick a set of messages from a batch by their index. Indexes larger than the number of messages are simply ignored.

# Config fields, showing default values
label: ""
select_parts:
  parts: []

The selected parts are added to the new message batch in the same order as the selection array. For examplem with ‘parts’ set to [ 2, 0, 1 ] and the message parts [ ‘0’, ‘1’, ‘2’, ‘3’ ], the output will be [ ‘2’, ‘0’, ‘1’ ].

If none of the selected parts exist in the input batch (resulting in an empty output message) the batch is dropped entirely.

Message indexes can be negative, and if so the part will be selected from the end counting backwards starting from -1. For example, if index = -1 then the selected part will be the last part of the message, if index = -2 then the part before the last element with be selected, and so on.

This processor is only applicable to batched messages.

Fields

parts

An array of message indexes of a batch. Indexes can be negative, and if so the part will be selected from the end counting backwards starting from -1.

Type: array
Default: []