LogSieve is an offline command-line analyzer for Apache and Nginx access logs. It detects Apache/Nginx Combined, Common, and JSON Lines records and reports traffic volume, HTTP status classes, failing endpoints, client addresses, hourly activity, and response-time statistics.
The program is written in CuffScript. It does not make network requests.
- CuffScript compiler:
cuffc.exeon Windows, orcuffcon macOS/Linux. - Input files no larger than 32 MiB and 200,000 lines.
From the project directory on Windows:
.\run.batOn macOS/Linux, make sure cuffc is executable in the project directory or on your PATH, then run:
chmod +x run.sh
./run.shChoose Analyze an access log and enter a path relative to the project directory, for example input/access.log. The CuffScript runner confines file access to the script's directory by default; paths outside that root are rejected. Pressing Enter on an empty menu prompt, or sending end-of-file, exits the program.
- Combined Log Format: client address, identity, user, timestamp, request, status, bytes, referer, and user-agent.
- Common Log Format: the same format without referer and user-agent.
- Mixed Combined and Common records may appear in one file.
The parser expects the standard field order. Custom log_format layouts and arbitrary reordered fields are not inferred.
Each non-blank line must be a JSON object. The following field names are recognized; when more than one alias is present, the first name listed takes precedence.
| Meaning | Accepted fields |
|---|---|
| Client address | remote_addr, client_ip, ip |
| HTTP method | request_method, method |
| Request target | request_uri, uri, path |
| Status | status, status_code |
| Response bytes | body_bytes_sent, bytes_sent, bytes |
| Timestamp | time_local, timestamp, time, @timestamp |
| User-agent | http_user_agent, user_agent |
| HTTP version | http_version, protocol |
http_version and protocol may contain either a version such as 1.1 or a complete token such as HTTP/2.0. If neither is present, 1.1 is assumed. HTTP method case is preserved.
Response-time fields are optional:
| Field | Unit | Notes |
|---|---|---|
request_time |
seconds | Preferred when it contains a valid non-negative number or numeric string |
upstream_response_time |
seconds | Used when request_time is missing or invalid |
latency_ms |
milliseconds | Used when neither seconds field is valid |
response_time_ms |
milliseconds | Final fallback |
A dash or invalid value in an optional timing field does not invalidate the request; the parser tries the next supported timing field. Durations above one year are ignored as implausible. Byte counts must be non-negative whole numbers within the exact-integer range of the runtime.
Apache timestamps and ISO-like JSON timestamps are bucketed by the hour written in the log. Numeric Unix timestamps are bucketed in UTC. An absent or unrecognized timestamp is counted under no hourly bucket.
Choose Export reports (CSV + JSON) after a successful analysis. Files are written to reports/ and replaced on the next export:
summary.csv— overall counts and rates.statuses.csv,methods.csv— status-code and method counts.top-paths.csv,error-paths.csv,server-error-paths.csv— endpoint rankings.path-health.csv— endpoint request, failure, and server-error rates.clients.csv,client-errors.csv,client-server-errors.csv— client-address rankings.failures.csv— up to the first 100 HTTP 4xx/5xx records.malformed.csv— up to the first 20 malformed-line samples.response-times.csv,endpoint-latency.csv— overall and per-endpoint latency statistics.report.json— machine-readable aggregate report.
CSV values beginning with spreadsheet formula markers are prefixed to prevent them from being evaluated as formulas by common spreadsheet applications. Text displayed in the terminal has control and bidirectional-formatting characters replaced with spaces to prevent log content from manipulating the console; the original text remains available in the CSV/JSON exports. JSON output is encoded with the JSON library rather than assembled by string concatenation.
- Blank lines are counted separately and excluded from
total_linesand the parse-rate denominator.total_linestherefore means non-empty input lines. - A syntactically recognized access-log record increments
parsed_lines, even when its request line is invalid. Such records are counted ininvalid_requests. - Up to 20,000 distinct values are tracked per high-cardinality metric. Additional distinct values are grouped under
[other unique values]so counters and latency aggregates remain bounded. - Only the first 100 HTTP failure records and first 20 malformed samples are retained in memory; aggregate totals continue counting beyond those sample limits.
Windows:
.\tests\run.ps1macOS/Linux:
./tests/run.shThe runners use the compiler in the project directory when available; otherwise, they look for cuffc/cuffc.exe on PATH. Set CUFFC to use a different compiler executable. The test runner passes --root so the test program can import source modules and read fixtures.