v0.7.1 · updated · GitHub
Command line interface

CLI Reference

Entry point: caddy-analyze [flags] [source...] — sources resolved via Log Sources or caddy-analyzer.json. Below: every flag, its scope, and whether it touches the system.

Operational guide
For step-by-step explanations, use cases and subcommand-specific flags, see All commands.

Global flags — Scope & root

all = persistent on every subcommand. root only = only on the root command (not on tail etc.). No flag itself requires root; subcommands guard/block/unban do (see their pages).

Persistent — all subcommands

FlagShortDefaultScopeDescription
--fromallEntries after time (RFC3339 or 5m, 1h, 2d)
--toallEntries before time (RFC3339)
--status-sallFilter by status code(s) e.g. -s 200,404
--method-mallFilter by HTTP method
--path-pallPath glob (/api/* → regex)
--hostallFilter by Host substring
--ipallClient IP / CIDR
--exclude-ipallExclude IP / CIDR
--countryallKeep countries (ISO or name, needs GeoIP)
--exclude-countryallDrop countries (needs GeoIP)
--asnallKeep ASNs (needs GeoIP)
--exclude-asnallDrop ASNs
--grepallRegex (fallback substring) on URI/UA/IP
--2xx / --3xx / --4xx / --5xxfalseallStatus class shortcut
--errors-only-efalseall5xx only
--slowallSlower than duration
--max-latencyallFaster than duration
--min-size / --max-sizeallBytes with k/mb/gb suffix
--no-bots / --bots-onlyfalseallBot classifier
--levelallOperational level (error,warn,info,debug)
--ops-onlyfalseallNon-HTTP events only
--top-t10allTop N (0 disables)
--format-ftableallRoot reports: table|json|csv|html; top/diff: table|json|csv
--output-oallWrite to file
--compact-cfalseallCompact table
--defangfalseall.[.] for IOC sharing
--trust-forwardedfalseallTrust X-Forwarded-For last public hop
--max-cardinality100kallCap per counter (0 unlimited)
--geo-cache-ttl24hallGeoIP cache TTL
--geo-cache-size50kallGeoIP cache size
--ua-rotation10allUA rotation threshold
--namespace-nallK8s namespace
--geoip-dballGeoIP mmdb path (auto-discovery)
--no-auto-downloadfalseallDisable GeoIP auto-download
--againstallCompare with a baseline JSON file
--threshold20allRegression threshold percentage
--custom-patternsallLoad validated custom detection JSON; repeatable
--remote-urlallElasticsearch/OpenSearch bulk or Loki endpoint
--remote-indexcaddy-analyzerallElasticsearch/OpenSearch index
--remote-user/password/tokenallRemote Basic or Bearer authentication
--remote-batch-size/retries/backoff/timeoutallRemote delivery tuning

Root only

FlagShortScopeDescription
--follow-Froot onlyFollow new logs (fan-in)
--interval-iroot onlyRe-aggregate every duration (e.g. 10s)
--watch-wroot onlyLive TUI dashboard (8 tabs)
--detect-droot only26-category threat detection
--version-vroot onlyPrint version and exit
Root required?
No flag requires root by itself. The subcommands guard, block, unban require sudo because they modify firewall rules — see their pages for modifies firewall vs read-only.

Subcommands

CommandScopeDescription
tailread-onlyStream and colorize (local --detect)
topread-onlyRanked inspector (10 dimensions)
diffread-onlyCompare two logs
baselinewrites fileSave versioned analysis baselines
guardmodifies firewallAuto-block via iptables/nftables/Docker
block / unbanmodifies firewallManual firewall
blocklistwrites cache/config8 feeds, refresh/list/config/init
configwrites configPersist default source
export-sigmawrites file/stdout23 Sigma rules
updatereplaces binarySelf-update (cosign + SHA256)
whitelistwrites allowlistNever-block CIDRs

Details per subcommand: see sidebar Guard, Blocklist, Block / Unban, Top.