v2.1API
Command line
The parse, stats and tail commands with flags, output formats and exit codes.
The sverlo command is a thin wrapper over the library for working with logs from a terminal.
sverlo <command> [file...] [flags]With no file, or with -, standard input is read.
Commands#
| Command | What it does |
|---|---|
parse | Parses records and prints them |
stats | Prints a summary: line count, error share, time range, counts by level |
tail | Like parse, but follows the file and prints new records (since version 2.1) |
Flags#
| Flag | Description |
|---|---|
--format <name> | A built-in format |
--pattern <pattern> | Your own pattern |
--query <query> | A query to filter with |
--out json|table|count | Output form; json by default (one record per line) |
--since, --until | Time bounds, 2026-10-01 or with a time |
--limit <n> | Stop after n records |
--timezone <zone> | Zone for lines without an offset |
--strict | Any unparsed line ends the run with exit code 3 |
Examples#
# the last five errors from a gzip archive
zcat access.log.gz | sverlo parse --format nginx-combined --query 'status:5xx' --out table --limit 5
# number of warnings within one hour
sverlo parse app.log --pattern '{ts:iso} {level:level} {msg:rest}' \
--since 2026-10-01T09:00:00Z --until 2026-10-01T10:00:00Z --query 'level:warn' --out countExit codes#
| Code | Meaning |
|---|---|
0 | Success |
1 | Usage error: unknown flag, neither --format nor --pattern |
2 | File not found or not readable |
3 | Unparsed lines with --strict |