Add --color-field for per-value highlighting#3454
Open
omdxp wants to merge 1 commit intojqlang:masterfrom
Open
Add --color-field for per-value highlighting#3454omdxp wants to merge 1 commit intojqlang:masterfrom
--color-field for per-value highlighting#3454omdxp wants to merge 1 commit intojqlang:masterfrom
Conversation
Adds a new CLI option to colorize object string values based on key=value rules, intended for structured log fields like level. Includes docs updates, a manpage regen, and tests.
Author
What this addsNew CLI flag: Example (realistic app logs)Input (NDJSON): {"time":"2025-12-16T23:11:01Z","level":"debug","msg":"starting server"}
{"time":"2025-12-16T23:11:02Z","level":"info","msg":"request","status":200}
{"time":"2025-12-16T23:11:03Z","level":"warn","msg":"slow query","duration_ms":842}
{"time":"2025-12-16T23:11:04Z","level":"error","msg":"upstream timeout","attempt":3}Command: jq -c \
--color-field 'level=debug:0;36' \
--color-field 'level=info:0;32' \
--color-field 'level=warn:1;33' \
--color-field 'level=error:1;31' \
'.'Expected terminal appearance (approx):
Raw ANSI proof (same output, escape bytes visible):
Notes
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new CLI option to colorize object string values based on key=value rules, intended for structured log fields like level. Includes docs updates, a manpage regen, and tests.