github.com/Jeffail/benthos/v3@v3.65.0/website/docs/components/inputs/stdin.md (about) 1 --- 2 title: stdin 3 type: input 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/input/stdin.go 13 --> 14 15 import Tabs from '@theme/Tabs'; 16 import TabItem from '@theme/TabItem'; 17 18 19 Consumes data piped to stdin as line delimited messages. 20 21 22 <Tabs defaultValue="common" values={[ 23 { label: 'Common', value: 'common', }, 24 { label: 'Advanced', value: 'advanced', }, 25 ]}> 26 27 <TabItem value="common"> 28 29 ```yaml 30 # Common config fields, showing default values 31 input: 32 label: "" 33 stdin: 34 codec: lines 35 ``` 36 37 </TabItem> 38 <TabItem value="advanced"> 39 40 ```yaml 41 # All config fields, showing default values 42 input: 43 label: "" 44 stdin: 45 codec: lines 46 max_buffer: 1000000 47 ``` 48 49 </TabItem> 50 </Tabs> 51 52 If the multipart option is set to true then lines are interpretted as message 53 parts, and an empty line indicates the end of the message. 54 55 If the delimiter field is left empty then line feed (\n) is used. 56 57 ## Fields 58 59 ### `codec` 60 61 The way in which the bytes of a data source should be converted into discrete messages, codecs are useful for specifying how large files or contiunous streams of data might be processed in small chunks rather than loading it all in memory. It's possible to consume lines using a custom delimiter with the `delim:x` codec, where x is the character sequence custom delimiter. Codecs can be chained with `/`, for example a gzip compressed CSV file can be consumed with the codec `gzip/csv`. 62 63 64 Type: `string` 65 Default: `"lines"` 66 Requires version 3.42.0 or newer 67 68 | Option | Summary | 69 |---|---| 70 | `auto` | EXPERIMENTAL: Attempts to derive a codec for each file based on information such as the extension. For example, a .tar.gz file would be consumed with the `gzip/tar` codec. Defaults to all-bytes. | 71 | `all-bytes` | Consume the entire file as a single binary message. | 72 | `chunker:x` | Consume the file in chunks of a given number of bytes. | 73 | `csv` | Consume structured rows as comma separated values, the first row must be a header row. | 74 | `csv:x` | Consume structured rows as values separated by a custom delimiter, the first row must be a header row. The custom delimiter must be a single character, e.g. the codec `"csv:\t"` would consume a tab delimited file. | 75 | `delim:x` | Consume the file in segments divided by a custom delimiter. | 76 | `gzip` | Decompress a gzip file, this codec should precede another codec, e.g. `gzip/all-bytes`, `gzip/tar`, `gzip/csv`, etc. | 77 | `lines` | Consume the file in segments divided by linebreaks. | 78 | `multipart` | Consumes the output of another codec and batches messages together. A batch ends when an empty message is consumed. For example, the codec `lines/multipart` could be used to consume multipart messages where an empty line indicates the end of each batch. | 79 | `regex:(?m)^\d\d:\d\d:\d\d` | Consume the file in segments divided by regular expression. | 80 | `tar` | Parse the file as a tar archive, and consume each file of the archive as a message. | 81 82 83 ```yaml 84 # Examples 85 86 codec: lines 87 88 codec: "delim:\t" 89 90 codec: delim:foobar 91 92 codec: gzip/csv 93 ``` 94 95 ### `max_buffer` 96 97 The maximum message buffer size. Must exceed the largest message to be consumed. 98 99 100 Type: `int` 101 Default: `1000000` 102 103