>_ZCOLORIZER
Pipe logs in, get cyberpunk-colored logs out. A Rust port of ccze and the pygments regex→token idea, built on three decoupled pieces: rules tag spans of a line with semantic tokens (date, error, host…), a theme maps each token to a color, and the engine paints the line. Fully customizable rules in TOML, 31 swappable themes, and all 47 format modules (20 classic ccze ports + 27 modern) — cyberpunk by default.
Quickstart
Install from crates.io or source, then pipe any log through it:
# install cargo install zcolorizer # from source git clone https://github.com/MenkeTechnologies/zcolorizer cd zcolorizer && cargo build --release # stream logs (line-buffered — tail -f / journalctl -f stay live) tail -f /var/log/syslog | zcolorizer -m syslog journalctl -f | zcolorizer --theme synth-wave zcolorizer access.log | less -R # enable a format module (or all of them) zcolorizer -m httpd access.log zcolorizer -m all mixed.log # every module; each only fires on matching lines
With no files it reads stdin. Color auto-disables when piped to a non-terminal — use -C/--force-color to keep it (e.g. into a pager).
How it works
Three things you can change independently — edit one without disturbing the others:
| Piece | Decides | Lives in |
|---|---|---|
| Rules | which text gets a semantic token (date, error, ip…) | regexes — fully editable in the config |
| Themes | what each token looks like (color + bold/underline/…) | a token→style map you swap live |
| Engine | runs the rules, paints claimed spans with the active theme | src/engine.rs |
A rule is a regex whose named capture groups are tokens — one pattern can paint several fields:
(?P<date>\d{4}-\d\d-\d\d)\s+(?P<host>\S+)\s+(?P<error>ERROR)
Because color lives entirely in the theme, switching themes recolors every log without touching a single rule.
Themes (31 + ccze-classic)
The cyberpunk palettes are ported from the shared MenkeTechnologies theme set (iftoprs / storageshower). Default is neon-sprawl (alias cyberpunk). Pick with -t/--theme, list with --list-themes, customize or add your own in the config.
…and 23 more: ice-breaker, rust-belt, ghost-wire, sakura-den, data-stream, solar-flare, neon-noir, chrome-heart, void-walker, cyber-frost, plasma-core, steel-nerve, dark-signal, glitch-pop, holo-shift, deep-net, laser-grid, quantum-flux, bio-hazard, darkwave, overlock, zaibatsu, iftopcolor — plus ccze-classic for 16-color parity.
Format modules (ccze plugin ports)
The generic ruleset colors any log out of the box. For known formats, enable a module — a port of the corresponding ccze plugin — to color structured fields precisely. Modules layer on top of the generic rules (they win on overlap, but a free-text message still flows through the generic word-colorizer — exactly ccze's design). Enable with -m/--module (repeatable) or all.
| Module | Colorises |
|---|---|
| syslog | Generic syslog(8): date, host, proc[pid], message |
| httpd | Apache/nginx access & error logs |
| squid | squid access, store and cache logs (TCP_HIT/MISS, hierarchy) |
| dpkg | Debian dpkg status / action / conffile lines |
| postfix | Postfix queue sub-logs (spoolid, field=value) |
| exim | Exim MTA: message-id, in/out arrows |
| procmail | procmail From / Subject / Folder |
| proftpd · vsftpd · ftpstats · xferlog | FTP access / transfer records |
| php | PHP error log levels |
| oops · icecast · fetchmail | proxy stats · streaming · mail retrieval |
| apm · distcc · sulog · super · ulogd | power · distributed compile · su · privilege · netfilter |
47 modules total — run zcolorizer --list-modules.
Configuration
Copy config.example.toml to ~/.config/zcolorizer/config.toml. Everything is optional — a one-liner is valid. Set the active theme, override individual colors, add your own rules, and enable modules:
theme = "cyberpunk" # any builtin, or one you define
modules = ["syslog", "httpd"] # or ["all"]
rules_mode = "prepend" # your rules win over builtins
# override just a few colors of a builtin theme
[[themes]]
name = "cyberpunk"
[themes.styles.error]
fg = "#ff003c"
bold = true
underline = true
# your own rule — named groups ARE tokens; whole-match uses `token`
[[rules]]
name = "uuid"
pattern = '\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b'
token = "address"
ignore_case = true
Color forms: "#ff00aa" (truecolor), "bright_cyan" (named ANSI), { index = 213 } (256-color). Style flags: bold dim italic underline blink reverse.
CLI reference
| Flag | Description |
|---|---|
| -t, --theme NAME | theme to use (default neon-sprawl, alias cyberpunk) |
| -m, --module NAME | enable a format module (repeatable; all) |
| -c, --config PATH | config file (default ~/.config/zcolorizer/config.toml) |
| -C, --force-color | color even when stdout is not a TTY |
| --no-color | never color (passthrough) |
| --list-themes | list all themes (active marked with *) |
| --list-modules | list the 47 format modules |
| --list-rules | list effective rules after config merge |
| --themes-json | emit every theme as JSON (for tooling) |
| --dump-config | print the resolved config as TOML |
| -h, --help | cyberpunk house-style help |
| -V, --version | print version |
Repository & links
- Source — GitHub repo
- Crate — crates.io (
cargo install zcolorizer) - Rust API docs — docs.rs
- Issues — issue tracker
- Full README — README on GitHub (install, config, themes, modules, architecture).
- Upstream — ported from ccze (the Rust port is original; no GPL code ships in the crate).