Connectors / Files & object stores

SFTP

source

SFTP source; list/glob a remote dir, stream JSONL/JSON-array/raw-text

Install

cargo install faucet-cli --features source-sftp
faucet init --source sftp
# Cargo.toml — use it as a library
cargo add faucet-source-sftp

Starter config

source:
  type: sftp
  config:
    host: ""    # REQUIRED — Server hostname or IP address.
    # port: 22    # Server port (default: 22).
    username: ""    # REQUIRED — SSH username.
    # known_hosts: { type: strict }    # one of: strict, accept_new, insecure
      # --- Alternative variants — replace the block above with one of these ---
      # type: accept_new
      #
      # type: insecure
    # connect_timeout_secs: 30    # Seconds the TCP connect, SSH handshake and authentication together may take, and then each SFTP channel's start (default 30).
    # keepalive_interval_secs: 15    # Seconds between SSH keepalives on a quiet connection (default 15); the connection is dropped after three go unanswered.
    path: ""    # REQUIRED — Remote path to read: a directory whose files are listed and streamed, or a single file.
    # glob: null    # Optional filename glob (`*` / `?`) applied to the basenames of files in a directory listing.
    # format: null    # Format of the remote files read by the SFTP source.
    # batch_size: 1000    # Records per emitted `StreamPage`.
    # concurrency: 4    # Maximum number of files read concurrently (default: 4).
    # csv: { ... }    # CSV dialect.
    # excel: { ... }    # Excel worksheet selection.
    # xml: { ... }    # XML record framing.
    # avro: { ... }    # Avro read/write options.
    # orc: { ... }    # ORC read options.
    # parquet: { ... }    # Parquet reader options (the `parquet:` block of an object-store source).
    # max_object_bytes: 2147483648    # Largest file, in bytes, a format read whole into memory (JSON array, raw text, CSV, XML, Excel, Avro, ORC) may reach; a larger one fails with an error naming it instead of exhausting memory.
    # max_decoded_bytes: 0    # Most bytes one object may decode to in memory where a format can expand past its input: an Avro file's records (per batch where the file streams), an Excel workbook's parts and shared strings.
    # max_listed_entries: 1000000    # Entries one directory listing may scan (default 1,000,000).
    # list_timeout_secs: 300    # Seconds the directory listing may take (default 300), including the stat of each symbolic link in it; a slower listing fails the run with an error naming this field.

Capabilities

Replay Non-deterministic replay
Exactly-once replay No
Incremental No
Dataset discovery No
Reports lag No
Compression No

Config fields

FieldTypeDefaultDescription
host
required
string — Server hostname or IP address.
username
required
string — SSH username.
path
required
string — Remote path to read: a directory whose files are listed and streamed, or a single file.
port integer 22 Server port (default: 22).
known_hosts object mode: accept_new Host-key verification policy (default: accept_new).
connect_timeout_secs integer 30 Seconds the TCP connect, SSH handshake and authentication together may take, and then each SFTP channel's start (default 30). A server that accepts and then stalls fails the run instead of hanging it.
keepalive_interval_secs integer 15 Seconds between SSH keepalives on a quiet connection (default 15); the connection is dropped after three go unanswered. 0 disables them.
glob string — Optional filename glob (* / ?) applied to the basenames of files in a directory listing. Ignored when path points at a single file.
format object jsonl Format of the files to read (default: jsonl).
batch_size integer 1000 Records per emitted StreamPage. For jsonl / raw_text, files are decoded incrementally and a page is yielded whenever the buffer reaches this size (bounded memory). For json_array, each file is buffered fully, then its records are chunked into pages of this size. Defaults to DEFAULT_BATCH_SIZE.
concurrency integer 4 Maximum number of files read concurrently (default: 4).
csv object delimiter: ","has_headers: truequote: "on_unknown_field: widen CSV dialect, used when format: csv (#604).
excel object header_row: 0 Worksheet selection, used when format: xlsx (#604).
xml object record_element: recordroot_element: records Record framing, used when format: xml (#604).
avro object codec: null Reader schema, used when format: avro (#719).
orc object {} Column projection, used when format: orc (#719).
parquet object {} Column projection, used when format: parquet (#777).
max_object_bytes integer 2147483648 Largest file, in bytes, a format read whole into memory (JSON array, raw text, CSV, XML, Excel, Avro, ORC) may reach; a larger one fails with an error naming it instead of exhausting memory. It also bounds one line of a streamed jsonl file, so a file with no newline fails the same way; parquet streams, and this caps one byte range it reads. Default 2 GiB.
max_decoded_bytes integer — Most bytes one object may decode to in memory where a format can expand past its input: an Avro file's records (per batch where the file streams), an Excel workbook's parts and shared strings. A file past it fails with an error instead of exhausting memory. Default 64 × max_object_bytes, at most 16 GiB.
max_listed_entries integer 1000000 Entries one directory listing may scan (default 1,000,000). Every entry the server sends counts, whether or not it matches glob; a directory with more fails the run with an error naming this field. Must be at least 1.
list_timeout_secs integer 300 Seconds the directory listing may take (default 300), including the stat of each symbolic link in it; a slower listing fails the run with an error naming this field. 0 is treated as 1.
Get started

Your first pipeline runs in five minutes.

Install the CLI, scaffold a config, and move real data — nothing external to stand up.

curl -LsSf https://github.com/faucet-hq/faucet-stream/releases/latest/download/faucet-cli-installer.sh | sh
brew install faucet-hq/faucet-stream/faucet-cli