github.com/Jeffail/benthos/v3@v3.65.0/website/docs/components/processors/insert_part.md (about)

     1  ---
     2  title: insert_part
     3  type: processor
     4  status: stable
     5  categories: ["Composition"]
     6  ---
     7  
     8  <!--
     9       THIS FILE IS AUTOGENERATED!
    10  
    11       To make changes please edit the contents of:
    12       lib/processor/insert_part.go
    13  -->
    14  
    15  import Tabs from '@theme/Tabs';
    16  import TabItem from '@theme/TabItem';
    17  
    18  
    19  Insert a new message into a batch at an index. If the specified index is greater
    20  than the length of the existing batch it will be appended to the end.
    21  
    22  ```yaml
    23  # Config fields, showing default values
    24  label: ""
    25  insert_part:
    26    index: -1
    27    content: ""
    28  ```
    29  
    30  The index can be negative, and if so the message will be inserted from the end
    31  counting backwards starting from -1. E.g. if index = -1 then the new message
    32  will become the last of the batch, if index = -2 then the new message will be
    33  inserted before the last message, and so on. If the negative index is greater
    34  than the length of the existing batch it will be inserted at the beginning.
    35  
    36  The new message will have metadata copied from the first pre-existing message of
    37  the batch.
    38  
    39  This processor will interpolate functions within the 'content' field, you can
    40  find a list of functions [here](/docs/configuration/interpolation#bloblang-queries).
    41  
    42  ## Fields
    43  
    44  ### `index`
    45  
    46  The index within the batch to insert the message at.
    47  
    48  
    49  Type: `int`  
    50  Default: `-1`  
    51  
    52  ### `content`
    53  
    54  The content of the message being inserted.
    55  This field supports [interpolation functions](/docs/configuration/interpolation#bloblang-queries).
    56  
    57  
    58  Type: `string`  
    59  Default: `""`  
    60  
    61