Skip to main content

stdin

Consumes data piped to stdin as line delimited messages.

# Common config fields, showing default values
input:
label: ""
stdin:
codec: lines

If the multipart option is set to true then lines are interpretted as message parts, and an empty line indicates the end of the message.

If the delimiter field is left empty then line feed (\n) is used.

Fields​

codec​

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.

Type: string
Default: "lines"
Requires version 3.42.0 or newer

OptionSummary
autoEXPERIMENTAL: 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.
all-bytesConsume the entire file as a single binary message.
chunker:xConsume the file in chunks of a given number of bytes.
csvConsume structured rows as comma separated values, the first row must be a header row.
csv:xConsume 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.
delim:xConsume the file in segments divided by a custom delimiter.
gzipDecompress a gzip file, this codec should precede another codec, e.g. gzip/all-bytes, gzip/tar, gzip/csv, etc.
linesConsume the file in segments divided by linebreaks.
multipartConsumes 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.
regex:(?m)^\d\d:\d\d:\d\dConsume the file in segments divided by regular expression.
tarParse the file as a tar archive, and consume each file of the archive as a message.
# Examples
codec: lines
codec: "delim:\t"
codec: delim:foobar
codec: gzip/csv

max_buffer​

The maximum message buffer size. Must exceed the largest message to be consumed.

Type: int
Default: 1000000