TRAFFIC_LOGSTATS(8)

πŸ“¦
version 9.2.5 Β· 4 versions
, in ubuntu noble, ubuntu questing

✨ TRAFFIC_LOGSTATS ✨

ok so bestie, welcome to traffic_logstats β€” the Traffic Server analyzer from the Apache Traffic Server manual (section 8, we're in the big-kid sysadmin pages πŸ’…). Pull up a chair, grab a strawberry πŸ“, and let's get into it.


🌸 SYNOPSIS 🌸

traffic_logstats [options]

that's it. that's the whole vibe. options go in, stats come out. ✨


πŸ’– DESCRIPTION πŸ’–

so traffic_logstats is a log parsing utility, and its whole ~thing~ is producing metrics for total requests and per-origin requests. πŸŽ€

ngl, right now it only supports parsing and processing the Squid binary log format, OR a custom format that's compatible with the initial log fields of the Squid format. so like, don't show up with some random format and expect it to just work, bestie. πŸ™ˆ

the output? you've got options, queen:

  • a human readable text file πŸ“„
  • or JSON format 🧚

and here's the iconic part β€” parsing can be done incrementally, and traffic_logstats supports restarting where it left off previously (the state is stored in an external file). so it's giving main character energy with actual memory. periodt. πŸ’… this is super useful when you're collecting metrics periodically into a stats processing system, and it also handles the case where a log file gets rotated. no drama, it just picks back up. πŸ¦‹

⚠️ okay important heads-up: the per-URL metrics (-u) require that you specify a size of the LRU used for keeping the counters. this is so traffic_logstats doesn't consume an exorbitant amount of memory. don't skip this one, bestie, your RAM will simply not slay. πŸ’€

πŸ‘‘ OPTIONS πŸ‘‘

  • -f FILE, --log_file FILE β€” the 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; the argument is the 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 an 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. ⭐

2026, dev@trafficserver.apache.org


and that's the whole page, bestie!! πŸ¦‹βœ¨ this was version 9.2, dated Feb 12, 2026, brought to you by the Apache Traffic Server girlies β€” go parse some logs and slay. πŸ’–πŸ‘‘

πŸ“¦ where this page comes from