= sftp
:type: output
:status: beta
:categories: ["Network"]



////
     THIS FILE IS AUTOGENERATED!

     To make changes, edit the corresponding source file under:

     https://github.com/redpanda-data/connect/tree/main/internal/impl/<provider>.

     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 files to an SFTP server.

Introduced in version 3.39.0.

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

In order to have a different path for each object you should use function interpolations described xref:configuration:interpolation.adoc#bloblang-queries[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 of the server to connect to.


*Type*: `string`


=== `path`

The file to save the messages to on the server.
This field supports xref:configuration:interpolation.adoc#bloblang-queries[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.

|===

```yml
# Examples

codec: lines

codec: "delim:\t"

codec: delim:foobar
```

=== `credentials`

The credentials to use to log into the target 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.
[CAUTION]
====
This field contains sensitive information that usually shouldn't be added to a config directly, read our xref:configuration:secrets.adoc[secrets page for more info].
====



*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.
[CAUTION]
====
This field contains sensitive information that usually shouldn't be added to a config directly, read our xref:configuration:secrets.adoc[secrets page for more info].
====



*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`


