sftp

Writes files to an SFTP server.

Introduced in version 3.39.0.

# Configuration fields, showing default values
output:
  label: ""
  sftp:
    address: "" # No default (required)
    path: "" # No default (required)
    codec: all-bytes
    credentials:
      username: "" # No default (optional)
      password: "" # No default (optional)
      private_key_file: "" # No default (optional)
      private_key: "" # No default (optional)
      private_key_pass: "" # No default (optional)
    max_in_flight: 64

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

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 (or message batches) with the field max_in_flight.

Fields

address

The address (hostname or IP address) of the SFTP server to connect to.

Type: string

path

The file to save the messages to on the SFTP server. This field supports interpolation functions.

Type: string

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"

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.

delim:x

Append each message to the output stream followed by a custom delimiter.

lines

Append each message to the output stream followed by a line break.

# Examples

codec: lines

codec: "delim:\t"

codec: delim:foobar

credentials

The credentials required to log in to the SFTP server. This can include a username and password, or a private key for secure access.

Type: object

credentials.username

The username required to authenticate with the SFTP server.

Type: string

Default: ""

credentials.password

The password for the username used to authenticate with the SFTP server.

This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see Secrets.

Type: string

Default: ""

credentials.private_key_file

The path to a private key file used to authenticate with the SFTP server. You can also provide a private key using the private_key field.

Type: string

Default: ""

credentials.private_key

The private key used to authenticate with the SFTP server. This field provides an alternative to the private_key_file.

This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see Secrets.

Type: string

credentials.private_key_pass

A passphrase for private key.

This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see Secrets.

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: 64