Skip to main content

Module logformat

Module logformat 

Source
Expand description

Web server and system log formats: nginx / Apache access logs, AWS load balancer logs (Application and Classic), IIS logs (W3C extended) and syslog (RFC 3164 and RFC 5424). A log’s format is recognised from its first lines; its lines are split into columns (a CSV table), and a web log is summed up in one streaming pass into ready reports: the top URLs, the requests and 5xx errors per minute, and the slowest requests.

Structs§

Format
A log’s format and its columns.
Minute
The requests of one minute.
Report
Slow
One of the slowest requests.
Splitter
Splits lines into a format’s columns.
UrlStat
The requests to one URL.

Enums§

Kind
Split
What a line is.

Constants§

SLOW_MAX
Slowest requests kept.
URLS_MAX
Most different URLs counted; the requests to others are counted together.

Functions§

detect
The format of a log, from its first lines (None for other logs, and for UTF-16 text).
minutes_csv
The requests and errors per minute as CSV, in time order.
report
The reports of a web log, in one pass; partial gets the report so far every few seconds. None when cancelled.
slow_csv
The slowest requests as CSV, slowest first.
to_csv
The log as a CSV table in the format’s columns. Returns (rows, lines in another format), or None when cancelled. The bytes are written as they are (the log’s encoding is kept).
urls_csv
The top URLs as CSV (all of them, or the first top).
write_summary
The reports as text for a terminal: totals, then the first top rows of each.