package report // cyberpunkCSS is the shared stylesheet used by both the daily report and // the index page. It does not include map-specific rules or page-specific // overrides (those live in reportExtraCSS / each template's own

// nxstats //

nginx log analysis report{{if .DayTitle}} — {{.DayTitle}}{{end}} — generated {{.GeneratedAt.Format "2006-01-02 15:04:05 UTC"}}
{{if .IndexFile}} {{end}}
Total Requests
{{.TotalRequests}}
Unique IPs
{{.UniqueIPs}}
Total Bytes
{{formatBytes .TotalBytes}}
Error Rate
{{formatFloat .ErrorRate}}%

// Charts

Status Code Distribution

Top 10 Paths

Requests per Hour

{{if .GeoLocations}}

// Geographic Distribution

{{end}}

// Top IPs

{{range $i, $ip := .TopIPs}} {{end}}
#IP AddressRequests
{{add $i 1}} {{$ip.IP}} {{$ip.Count}}

// Top Paths

{{range $i, $p := .TopPaths}} {{end}}
#PathRequestsTop Status
{{add $i 1}} {{$p.Path}} {{$p.Count}} {{statusBadge $p.TopStatus}}

// Access Log

TimeIPMethodPathStatusBytesUser Agent

// Error Log

TimeLevelPIDConnMessage
` // indexTemplate is the cyberpunk-themed HTML template for the index page // generated by --split-by-day. It lists all daily reports with aggregate stats. const indexTemplate = ` nxstats — Daily Index

// nxstats //

daily index — generated {{.GeneratedAt.Format "2006-01-02 15:04:05 UTC"}}
Total Requests
{{.TotalRequests}}
Unique IPs
{{.TotalUniqueIPs}}
Total Bytes
{{formatBytes .TotalBytes}}
Overall Error Rate
{{formatFloat .OverallErrorRate}}%
Days Covered
{{len .Days}}

// Daily Breakdown

{{range .Days}} {{end}}
Date Requests Unique IPs Bytes Error Rate
{{fmtDate .Date}} {{.Requests}} {{.UniqueIPs}} {{formatBytes .TotalBytes}} {{formatFloat .ErrorRate}}%
`