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

     1  ---
     2  title: stdout
     3  type: output
     4  status: stable
     5  categories: ["Local"]
     6  ---
     7  
     8  <!--
     9       THIS FILE IS AUTOGENERATED!
    10  
    11       To make changes please edit the contents of:
    12       lib/output/stdout.go
    13  -->
    14  
    15  import Tabs from '@theme/Tabs';
    16  import TabItem from '@theme/TabItem';
    17  
    18  
    19  Prints messages to stdout as a continuous stream of data, dividing messages according to the specified codec.
    20  
    21  ```yaml
    22  # Config fields, showing default values
    23  output:
    24    label: ""
    25    stdout:
    26      codec: lines
    27  ```
    28  
    29  ## Batches and Multipart Messages
    30  
    31  When writing multipart (batched) messages using the `lines` codec the last message ends with double delimiters. E.g. the messages "foo", "bar" and "baz" would be written as:
    32  
    33  ```
    34  foo\n
    35  bar\n
    36  baz\n
    37  ```
    38  
    39  Whereas a multipart message [ "foo", "bar", "baz" ] would be written as:
    40  
    41  ```
    42  foo\n
    43  bar\n
    44  baz\n\n
    45  ```
    46  
    47  This enables consumers of this output feed to reconstruct the original batches. However, if you wish to avoid this behaviour then add a [`split` processor](/docs/components/processors/split) before messages reach this output.
    48  
    49  ## Fields
    50  
    51  ### `codec`
    52  
    53  The way in which the bytes of messages should be written out into the output data stream. It's possible to write lines using a custom delimiter with the `delim:x` codec, where x is the character sequence custom delimiter.
    54  
    55  
    56  Type: `string`  
    57  Default: `"lines"`  
    58  Requires version 3.46.0 or newer  
    59  
    60  | Option | Summary |
    61  |---|---|
    62  | `all-bytes` | Only applicable to file based outputs. Writes each message to a file in full, if the file already exists the old content is deleted. |
    63  | `append` | Append each message to the output stream without any delimiter or special encoding. |
    64  | `lines` | Append each message to the output stream followed by a line break. |
    65  | `delim:x` | Append each message to the output stream followed by a custom delimiter. |
    66  
    67  
    68  ```yaml
    69  # Examples
    70  
    71  codec: lines
    72  
    73  codec: "delim:\t"
    74  
    75  codec: delim:foobar
    76  ```
    77  
    78