---
name: "traffic_logstats"
section: "8"
platform: "linux"
package: "trafficserver"
version: "9.2.5+ds-0+deb12u4"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/traffic_logstats"
---

# traffic\_logstats(8)

Traffic Server analyzer

## NAME

traffic\_logstats - Traffic Server analyzer

## SYNOPSIS

**traffic\_logstats** \[options\]

## DESCRIPTION

**traffic\_logstats** is a log parsing utility, that is intended to produce metrics for total and per origin requests. Currently, this utility only supports parsing and processing the Squid binary log format, or a custom format that is compatible with the initial log fields of the Squid format.

Output can either be a human readable text file, or a JSON format. Parsing can be done incrementally, and **traffic\_logstats** supports restarting where it left off previously (state is stored in an external file). This is useful when collecting metrics periodically into a stats processing system, and also supports the case where a log file is rotated.

The per-URL metrics (*-u*) requires that you specify a size of the LRU used for keeping the counters. This is to assure that **traffic\_logstats** does not consume an exorbitant amount of memory.

## OPTIONS

- **-f FILE, --log\_file FILE**

  Specific logfile to parse

- **-o LIST, --origin\_list LIST**

  Only show stats for listed Origins

- **-O FILE, --origin\_file FILE**

  File listing Origins to show

- **-M COUNT, --max\_origins COUNT**

  Max number of Origins to show

- **-u COUNT, --urls COUNT**

  Produce JSON stats for URLs, argument is LRU size

- **-U COUNT, --show\_urls COUNT**

  Only show max this number of URLs

- **-A, --as\_object**

  Produce URL stats as a JSON object instead of array

- **-C, --concise**

  Eliminate metrics that can be inferred from other values

- **-i, --incremental**

  Incremental log parsing

- **-S FILE, --statetag FILE**

  Name of the state file to use

- **-t, --tail**

  Parse the last \<sec\> seconds of log

- **-s, --summary**

  Only produce the summary

- **-j, --json**

  Produce JSON formatted output

- **-c, --cgi**

  Produce HTTP headers suitable as a CGI

- **-m, --min\_hits**

  Minimum total hits for an Origin

- **-a, --max\_age**

  Max age for log entries to be considered

- **-l COUNT, --line\_len COUNT**

  Output line length

- **-T TAGS, --debug\_tags TAGS**

  Colon-Separated Debug Tags

- **-r, --report\_per\_user**

  Report stats per username of the authenticated client **caun** instead of host, see *squid log format*

- **-n, --no\_format\_check**

  Don't validate the log format field names according to the *squid log format*. This would allow squid format fields to be replaced, i.e. the username of the authenticated client **caun** with a random header value by using **cqh**, or to remove the client's host IP address from the log for privacy reasons.

- **-h, --help**

  Print usage information and exit.

- **-V, --version**

  Print version information and exit.

## COPYRIGHT

2026, dev@trafficserver.apache.org
