= select_parts
:type: processor
:status: stable
:categories: ["Utility"]



////
     THIS FILE IS AUTOGENERATED!

     To make changes, edit the corresponding source file under:

     https://github.com/redpanda-data/connect/tree/main/internal/impl/<provider>.

     And:

     https://github.com/redpanda-data/connect/tree/main/cmd/tools/docs_gen/templates/plugin.adoc.tmpl
////

// © 2024 Redpanda Data Inc.


component_type_dropdown::[]


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

```yml
# 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. E.g. 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. E.g. 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 xref:configuration:batching.adoc[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*: `[]`


