Skip to content

The HTML Report

Outcome: a single-file web page that carries your whole report — data, charts and all — and a way to check it against the log before you send it to anyone.

Making it

Add -o with an .html name to the same run:

goaccess access.log --log-format=COMBINED -o report.html

The lab's report is 576,404 bytes (transcript t05-html-and-csv.txt). Nearly all of that is the charting and table machinery: the file is self-contained, with its JavaScript, styles and the report's data embedded in the one document. There is no folder of assets to lose, no server needed to view it, and nothing phones home — open it from disk in any browser. That makes it the natural shape for sharing: one file to attach, archive, or drop on a shared drive. (Flags exist to split the assets out — --external-assets — for sites that host many reports; the single file is the right default.)

What is inside

The page opens on the same summary the dashboard shows — total and valid requests, unique visitors, bandwidth, log size — then presents every panel as a sortable table with a chart: visitors per day, requested files, static files, not found, hosts, operating systems, browsers, referring sites, status codes, and the visit-time graph. A reader can re-sort any panel, expand rows, and switch chart types without touching the log or the program.

One behavioural note the lab verified: the HTML is generated from the counted model, not from the file at view time. Re-running the command is the only way to refresh it — a saved report is a snapshot of the log as it stood. For a page that updates itself, you want the real-time mode of chapter 10 — a different beast, with a server attached.

Checking it before it travels

Reports get forwarded, and forwarded numbers acquire authority. The lab's checks, worth making a habit:

  • The page title is the plain Server Statistics, and the summary block's totals match the dashboard and the JSON of the same run — 27 requests, 5 unique visitors, 2 not found. If two outputs of one run disagree, rerun; do not ship either.
  • The not-found panel names the actual missing URLs (/no-such-page appears, as it should). A panel that looks plausible but generic is how a wrong log file gets reported on — confirm one detail only your log could contain.
  • Remember chapter 1's line: this file contains your visitors' addresses and reading history in friendly form. It travels like the log travels — to people who need it, kept no longer than needed.

A note on size

Half a megabyte for 27 requests sounds like a lot until you realise the size is almost all machinery: the same report over a million-line log is barely bigger, because the data grows by rows while the machinery is fixed. The HTML report is cheap at any scale you are likely to meet — which is precisely why it is the shareable shape, and the terminal dashboard remains the quick one.