github.com/Jeffail/benthos/v3@v3.65.0/website/docs/components/outputs/sftp.md (about) 1 --- 2 title: sftp 3 type: output 4 status: experimental 5 categories: ["Network"] 6 --- 7 8 <!-- 9 THIS FILE IS AUTOGENERATED! 10 11 To make changes please edit the contents of: 12 lib/output/sftp.go 13 --> 14 15 import Tabs from '@theme/Tabs'; 16 import TabItem from '@theme/TabItem'; 17 18 :::caution EXPERIMENTAL 19 This component is experimental and therefore subject to change or removal outside of major version releases. 20 ::: 21 Writes files to a server over SFTP. 22 23 Introduced in version 3.39.0. 24 25 ```yaml 26 # Config fields, showing default values 27 output: 28 label: "" 29 sftp: 30 address: "" 31 path: "" 32 codec: all-bytes 33 credentials: 34 username: "" 35 password: "" 36 private_key_file: "" 37 private_key_pass: "" 38 max_in_flight: 1 39 ``` 40 41 In order to have a different path for each object you should use function interpolations described [here](/docs/configuration/interpolation#bloblang-queries). 42 43 ## Batches and Multipart Messages 44 45 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: 46 47 ``` 48 foo\n 49 bar\n 50 baz\n 51 ``` 52 53 Whereas a multipart message [ "foo", "bar", "baz" ] would be written as: 54 55 ``` 56 foo\n 57 bar\n 58 baz\n\n 59 ``` 60 61 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](/docs/components/processors/split) before messages reach this output. 62 63 ## Performance 64 65 This output benefits from sending multiple messages in flight in parallel for 66 improved performance. You can tune the max number of in flight messages with the 67 field `max_in_flight`. 68 69 ## Fields 70 71 ### `address` 72 73 The address of the server to connect to that has the target files. 74 75 76 Type: `string` 77 Default: `""` 78 79 ### `path` 80 81 The file to save the messages to on the server. 82 83 84 Type: `string` 85 Default: `""` 86 87 ### `codec` 88 89 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. 90 91 92 Type: `string` 93 Default: `"all-bytes"` 94 95 | Option | Summary | 96 |---|---| 97 | `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. | 98 | `append` | Append each message to the output stream without any delimiter or special encoding. | 99 | `lines` | Append each message to the output stream followed by a line break. | 100 | `delim:x` | Append each message to the output stream followed by a custom delimiter. | 101 102 103 ```yaml 104 # Examples 105 106 codec: lines 107 108 codec: "delim:\t" 109 110 codec: delim:foobar 111 ``` 112 113 ### `credentials` 114 115 The credentials to use to log into the server. 116 117 118 Type: `object` 119 120 ### `credentials.username` 121 122 The username to connect to the SFTP server. 123 124 125 Type: `string` 126 Default: `""` 127 128 ### `credentials.password` 129 130 The password for the username to connect to the SFTP server. 131 132 133 Type: `string` 134 Default: `""` 135 136 ### `credentials.private_key_file` 137 138 The private key for the username to connect to the SFTP server. 139 140 141 Type: `string` 142 Default: `""` 143 144 ### `credentials.private_key_pass` 145 146 Optional passphrase for private key. 147 148 149 Type: `string` 150 Default: `""` 151 152 ### `max_in_flight` 153 154 The maximum number of messages to have in flight at a given time. Increase this to improve throughput. 155 156 157 Type: `int` 158 Default: `1` 159 160