pt-grep
Pattern search over very large log files. Streams from disk, keeps constant memory, and understands the timestamp formats most services actually emit.
v2.4.1 · released 2026-08-30
PTools is a handful of single-purpose utilities for the parts of engineering work that never quite fit into a pipeline. No daemon, no config file, no dependencies — just static binaries that do one thing and exit.
Four binaries, each under 4 MB, built to be piped into something else.
pt-grepPattern search over very large log files. Streams from disk, keeps constant memory, and understands the timestamp formats most services actually emit.
pt-sliceExtract a time window from a log without loading the whole file. Accepts absolute
ranges, relative offsets like --since 2h, and timezone overrides.
pt-csvStreaming CSV/TSV wrangling: select, reorder, filter and aggregate columns on files that do not fit in memory. Output stays valid CSV, including quoting edge cases.
pt-diffStructural diff for JSON, YAML and TOML. Reports what changed by path instead of dumping two walls of text and leaving you to spot the difference.
Every utility takes input on stdin or as a trailing file argument.
# errors in the last two hours, newest first pt-grep ERROR --since 2h /var/log/app/service.log # just the incident window, with timezone normalised to UTC pt-slice 09:40 10:15 --tz UTC access.log > incident.log # pull three columns out of a 2 GB export and sum one of them pt-csv export.csv --select ts,region,bytes --sum bytes --by region # what actually changed between two deploys pt-diff old/values.yaml new/values.yaml
Each binary exits non-zero on no match, so they compose with &&
and set -e without surprises.
pt-slice mishandling DST transitions in zone-aware timestamps.pt-csv gains --by for grouped aggregation; adds AVX2 build.pt-diff now preserves key order when comparing TOML tables.pt-grep and pt-slice.