= file :type: output :status: stable :categories: ["Local"] //// THIS FILE IS AUTOGENERATED! To make changes, edit the corresponding source file under: https://github.com/redpanda-data/connect/tree/main/internal/impl/. And: https://github.com/redpanda-data/connect/tree/main/cmd/tools/docs_gen/templates/plugin.adoc.tmpl //// // © 2024 Redpanda Data Inc. component_type_dropdown::[] Writes messages to files on disk based on a chosen codec. ```yml # Config fields, showing default values output: label: "" file: path: /tmp/data.txt # No default (required) codec: lines ``` Messages can be written to different files by using xref:configuration:interpolation.adoc#bloblang-queries[interpolation functions] in the path field. However, only one file is ever open at a given time, and therefore when the path changes the previously open file is closed. == Fields === `path` The file to write to, if the file does not yet exist it will be created. This field supports xref:configuration:interpolation.adoc#bloblang-queries[interpolation functions]. *Type*: `string` Requires version 3.33.0 or newer ```yml # Examples path: /tmp/data.txt path: /tmp/${! timestamp_unix() }.txt path: /tmp/${! json("document.id") }.json ``` === `codec` 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. *Type*: `string` *Default*: `"lines"` Requires version 3.33.0 or newer |=== | Option | Summary | `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. | `append` | Append each message to the output stream without any delimiter or special encoding. | `lines` | Append each message to the output stream followed by a line break. | `delim:x` | Append each message to the output stream followed by a custom delimiter. |=== ```yml # Examples codec: lines codec: "delim:\t" codec: delim:foobar ```