Skip to main content
Append records to a stream. Each newline-delimited input becomes one record.

From stdin

echo -e "hello world\nfoo bar\nthird record" \
  | s2 append s2://my-basin/my-stream
✓ [APPENDED] 0..3 // tail: 3 @ 1771390606217

From a file

s2 append s2://my-basin/my-stream -i records.txt

Interactive

Start an interactive append session where each line you type becomes a record:
s2 append s2://my-basin/my-stream

Piping from another process

nc starwars.s2.dev 23 | s2 append s2://my-basin/starwars

Encrypted streams

export S2_ENCRYPTION_KEY="$(openssl rand -base64 32)"

echo "top secret" | s2 append s2://my-basin/my-stream
Or provide the key explicitly:
echo "top secret" | s2 append s2://my-basin/my-stream \
  --encryption-key-file ./stream-key.b64

Options

FlagDescription
-f, --fencing-tokenEnforce fencing token.
-m, --match-seq-numEnforce that the sequence number issued to the first record matches.
--formatInput format.
--lingerHow long to wait for more records before flushing a batch.
-i, --inputInput newline delimited records to append from a file or stdin. Use - to read from stdin.
-k, --encryption-keyBase64-encoded encryption key material. Alternatively, set S2_ENCRYPTION_KEY.
--encryption-key-fileRead base64-encoded encryption key material from file.