FreeBSD Manual Pages
TCPSTATS-READER(1) General Commands Manual TCPSTATS-READER(1) NAME tcpstats-reader -- read TCP socket statistics from the tcpstats kernel mod- ule SYNOPSIS tcpstats-reader [-p] [-c count] [-i interval] DESCRIPTION The tcpstats-reader utility reads TCP connection statistics from the tcp- stats(4) kernel module via the /dev/tcpstats character device and outputs the data as JSON Lines to standard output. Each collection pass iterates all TCP connections visible to the reader and emits a single JSON object containing an array of per-connection records with fields such as TCP state, addresses, ports, congestion control parame- ters, RTT, sequence numbers, and buffer utilization. By default, tcpstats-reader runs continuously with a one-second interval between passes. Use the -c option to limit the number of passes. OPTIONS -c count, --count count Number of collection passes to perform. A value of 0 means run indefinitely. Default: 0. -i interval, --interval interval Collection interval in seconds. Fractional values are ac- cepted. Default: 1. -p, --pretty Pretty-print JSON output with indentation. -h, --help Display a help message and exit. EXIT STATUS The tcpstats-reader utility exits 0 on success, and >0 if an error occurs. EXAMPLES Collect a single snapshot with pretty-printed output: tcpstats-reader -c 1 -p Collect 10 passes at 5-second intervals: tcpstats-reader -c 10 -i 5 Stream continuously to a file: tcpstats-reader > /var/log/tcpstats.jsonl Pipe to jq(1) for filtering: tcpstats-reader -c 1 | jq '.records[] | select(.state == "ESTABLISHED")' SEE ALSO jq(1), tcp(4), tcpstats(4) HISTORY The tcpstats-reader utility first appeared as part of the bsd-xtcp project. AUTHORS The tcpstats-reader utility was written by Dave Seddon. FreeBSD ports 15.quarterly April 30, 2026 TCPSTATS-READER(1)
NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXIT STATUS | EXAMPLES | SEE ALSO | HISTORY | AUTHORS
Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=tcpstats-reader&sektion=1&manpath=FreeBSD+Ports+15.1.quarterly>
