High-traffic servers (100+ req/s) generated millions of log lines per day. Transferring raw lines over SSH was impractical (GB of data). Instead, run an awk script on the server that aggregates all matching log files (including .gz rotated ones) into time buckets and returns only a ~50-line summary. For a server doing 180 req/s this reduces SSH transfer from ~7GB to <1KB per history request. The awk script filters by timestamp, groups by bucket, and outputs: - per-bucket request counts, bytes, and status code groups - top hosts and IPs with counts - overall totals Files are pre-filtered with find -mtime to skip archives older than the requested window. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| app.go | ||