How tom-draper/log-analyzer works
Log Analyzer is a Go log-processing CLI that extracts typed fields from configured patterns, then serves a browser dashboard; it also supports export, format suggestions, and live-follow mode. The dashboard presents coverage, request summaries, per-token statistics, distributions, time trends, locations, and dependency views. The principal flow runs from CLI input through parsing and analysis into HTTP-served data consumed by the Svelte app. Several parser internals and dashboard components are unsampled, so their detailed internal links are omitted.
Main entry points: App.svelte Dashboard application · main.go CLI workflow · analyze.go Enrichment and run modes · Card.svelte Token analysis cards
Components 29
CLI and parsing
- CLI workflow
main.go - Pattern configuration
pkg/parse/config.go - Log extraction
pkg/parse/parse.go - Stream following
pkg/parse/follow.go - Format suggestion
main.go - Format similarity
pkg/similarity/similarity.go - Pattern clustering
pkg/similarity/kruskal.go
Analysis and output
- Enrichment and run modes
pkg/analyze/analyze.go - IP geolocation
internal/location/location.go - Export formatting
pkg/parse/export.go - Text display
pkg/parse/display.go
Dashboard service
- HTTP API
internal/server/api.go - Dashboard data store
internal/server/store.go
Dashboard interface
- Dashboard application
dashboard/src/App.svelte - Token analysis cards
dashboard/src/lib/Card.svelte - Dashboard summaries
dashboard/src/lib/DashboardMetrics.svelte - Pattern coverage
dashboard/src/lib/PatternCoverage.svelte - Request funnel
dashboard/src/lib/RequestFunnel.svelte - Event explorer
dashboard/src/lib/EventExplorer.svelte - Type warnings
dashboard/src/lib/TypeWarnings.svelte - Dependency frequency
dashboard/src/lib/ValueFreqGraphDependent.svelte - Dependency heatmap
dashboard/src/lib/DependencyHeatmap.svelte - Time trends
dashboard/src/lib/OverTimeGraph.svelte - Time breakdown
dashboard/src/lib/TimeBreakdown.svelte - Chart configuration
dashboard/src/lib/plot.ts - Time slot utilities
dashboard/src/lib/timeSlots.ts - Frontend entry
dashboard/src/main.ts
Other components
- Log analyst
- Browser user
Connections 31
- Log analyst → CLI workflow: runs
- CLI workflow → Pattern configuration: loads config
- CLI workflow → Log extraction: parses logs
main.go - CLI workflow → Enrichment and run modes: starts dashboard
main.go - CLI workflow → Stream following: starts follow
main.go - CLI workflow → Export formatting: exports records
- CLI workflow → Text display: prints records
- CLI workflow → Format suggestion: suggests patterns
main.go - Format suggestion → Format similarity: groups formats
main.go - Format similarity → Pattern clustering: uses clustering
- Enrichment and run modes → Log extraction: accepts extractions
pkg/analyze/analyze.go - Enrichment and run modes → IP geolocation: resolves IPs
pkg/analyze/analyze.go - Enrichment and run modes → Dashboard data store: updates store
pkg/analyze/analyze.go - Enrichment and run modes → HTTP API: starts server
pkg/analyze/analyze.go - HTTP API → Dashboard data store: reads and subscribes
internal/server/api.go - Browser user → Frontend entry: opens dashboard
- Frontend entry → Dashboard application: mounts
dashboard/src/main.ts - Dashboard application → HTTP API: fetches data
dashboard/src/App.svelte - Dashboard application → HTTP API: subscribes updates
dashboard/src/App.svelte - Dashboard application → Token analysis cards: renders cards
dashboard/src/App.svelte - Dashboard application → Dashboard summaries: renders metrics
dashboard/src/App.svelte - Dashboard application → Pattern coverage: renders coverage
dashboard/src/App.svelte - Dashboard application → Request funnel: renders funnel
dashboard/src/App.svelte - Dashboard application → Event explorer: renders explorer
dashboard/src/App.svelte - Dashboard application → Type warnings: renders warnings
dashboard/src/App.svelte - Token analysis cards → Dependency frequency: renders dependencies
dashboard/src/lib/Card.svelte - Token analysis cards → Dependency heatmap: renders heatmap
dashboard/src/lib/Card.svelte - Token analysis cards → Time trends: renders trends
dashboard/src/lib/Card.svelte - Token analysis cards → Time breakdown: renders breakdown
dashboard/src/lib/Card.svelte - Time breakdown → Chart configuration: uses layout
dashboard/src/lib/TimeBreakdown.svelte - Time trends → Time slot utilities: uses slots
dashboard/src/lib/OverTimeGraph.svelte