Skip to content
Sections
LanguageRUEN

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.

bash
sverlo <command> [file...] [flags]

With no file, or with -, standard input is read.

Commands#

CommandWhat it does
parseParses records and prints them
statsPrints a summary: line count, error share, time range, counts by level
tailLike parse, but follows the file and prints new records (since version 2.1)

Flags#

FlagDescription
--format <name>A built-in format
--pattern <pattern>Your own pattern
--query <query>A query to filter with
--out json|table|countOutput form; json by default (one record per line)
--since, --untilTime bounds, 2026-10-01 or with a time
--limit <n>Stop after n records
--timezone <zone>Zone for lines without an offset
--strictAny unparsed line ends the run with exit code 3

Examples#

bash
# 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 count

Exit codes#

CodeMeaning
0Success
1Usage error: unknown flag, neither --format nor --pattern
2File not found or not readable
3Unparsed lines with --strict

Updated: