Skip to main content

sftp

EXPERIMENTAL

This component is experimental and therefore subject to change or removal outside of major version releases.

Writes files to a server over SFTP.

Introduced in version 3.39.0.

# Config fields, showing default values
output:
label: ""
sftp:
address: ""
path: ""
codec: all-bytes
credentials:
username: ""
password: ""
private_key_file: ""
private_key_pass: ""
max_in_flight: 1

In order to have a different path for each object you should use function interpolations described here.

Batches and Multipart Messages​

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:

foo\n
bar\n
baz\n

Whereas a multipart message [ "foo", "bar", "baz" ] would be written as:

foo\n
bar\n
baz\n\n

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 before messages reach this output.

Performance​

This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages with the field max_in_flight.

Fields​

address​

The address of the server to connect to that has the target files.

Type: string
Default: ""

path​

The file to save the messages to on the server.

Type: string
Default: ""

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: "all-bytes"

OptionSummary
all-bytesOnly applicable to file based outputs. Writes each message to a file in full, if the file already exists the old content is deleted.
appendAppend each message to the output stream without any delimiter or special encoding.
linesAppend each message to the output stream followed by a line break.
delim:xAppend each message to the output stream followed by a custom delimiter.
# Examples
codec: lines
codec: "delim:\t"
codec: delim:foobar

credentials​

The credentials to use to log into the server.

Type: object

credentials.username​

The username to connect to the SFTP server.

Type: string
Default: ""

credentials.password​

The password for the username to connect to the SFTP server.

Type: string
Default: ""

credentials.private_key_file​

The private key for the username to connect to the SFTP server.

Type: string
Default: ""

credentials.private_key_pass​

Optional passphrase for private key.

Type: string
Default: ""

max_in_flight​

The maximum number of messages to have in flight at a given time. Increase this to improve throughput.

Type: int
Default: 1