Read records from a stream.Documentation Index
Fetch the complete documentation index at: https://s2.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
Read from the beginning
JSON output
Read from a timestamp
Read from a tail offset
Follow for new records
Without a limit (-n or -b), read keeps tailing and waits for new records indefinitely:
Encrypted streams
The same
--encryption-key and --encryption-key-file flags also apply to s2 tail.Options
| Flag | Description |
|---|---|
-s, --seq-num | Starting sequence number (inclusive). |
--timestamp | Starting timestamp in milliseconds since Unix epoch (inclusive). |
--ago | Starting timestamp as a human-friendly delta from current time e.g. “1h”, which will be converted to milliseconds since Unix epoch. |
--tail-offset | Start from N records before the tail of the stream. |
-n, --count | Limit the number of records returned. |
-b, --bytes | Limit the number of bytes returned. |
--until | Exclusive end-timestamp in milliseconds since Unix epoch. If provided, results will be limited such that all records returned will have a timestamp < the one provided via until. |
--clamp | Clamp the start position at the tail position. |
--format | Output format. |
-o, --output | Output records to a file or stdout. Use - to write to stdout. |
-k, --encryption-key | Base64-encoded encryption key material. Alternatively, set S2_ENCRYPTION_KEY. |
--encryption-key-file | Read base64-encoded encryption key material from file. |
Tail
Liketail on Unix, it shows the last N records from a stream.
-f:

