Releases: pamburus/hl
v0.24.1
v0.24.0
What's Changed
Added
-
Option
--query
by @pamburus in #112Usage
-
Command
$ hl my-service.log --query 'level > info or status-code >= 400 or duration > 0.5'
Displays messages that either have a level higher than info (i.e. warning or error) or have a status code field with a numeric value >= 400 or a duration field with a numeric value >= 0.5.
-
Command
$ hl my-service.log -q '(request in (95c72499d9ec, 9697f7aa134f, bc3451d0ad60)) or (method != GET)'
Displays all messages that have the 'request' field with one of these values, or the 'method' field with a value other than 'GET'.
-
Complete set of supported operators
- Logical operators
- Logical conjunction -
and
,&&
- Logical disjunction -
or
,||
- Logical negation -
not
,!
- Logical conjunction -
- Comparison operators
- Equal -
eq
,=
- Not equal -
ne
,!=
- Greater than -
gt
,>
- Greater or equal -
ge
,>=
- Less than -
lt
,<
- Less or equal -
le
,<=
- Equal -
- String matching operators
- Sub-string check - (
contain
,~=
), (not contain
,!~=
) - Wildcard match - (
like
), (not like
)- Wildcard characters are:
*
for zero or more characters and?
for a single character
- Wildcard characters are:
- Regular expression match - (
match
,~~=
), (not match
,!~~=
)
- Sub-string check - (
- Operators with sets
- Test if value is one of the values in a set -
in (v1, v2)
,not in (v1, v2)
- Test if value is one of the values in a set -
- Logical operators
-
Notes
- Special field names that are reserved for filtering by predefined fields regardless of the actual JSON field names used to load the corresponding value:
level
,message
,caller
andlogger
. - To address a JSON field with one of these names instead of predefined fields, add a period before its name, i.e.,
.level
will perform a match against the "level" JSON field. - To address a JSON field by its exact name, use a JSON-formatted string, i.e.
-q '".level" = info'
. - To specify special characters in field values, also use a JSON-formatted string, i.e.
$ hl my-service.log -q 'message contain "Error:\nSomething unexpected happened"'
- Special field names that are reserved for filtering by predefined fields regardless of the actual JSON field names used to load the corresponding value:
-
Full Changelog: v0.23.2...v0.24.0
v0.23.2
What's Changed
Added
- Option
--allow-prefix
and environment variableHL_ALLOW_PREFIX
by @pamburus in #111
It allows non-JSON prefixes before JSON log messages
Changed
- By default non-JSON prefixes are no longer allowed and should be enabled by
--allow-prefix
Fixed
- Fixed corrupted output in prefix mode by @pamburus in #109
- Fixed unwanted display of messages without level when filtering by level by @pamburus in #110
Full Changelog: v0.23.0...v0.23.2
v0.23.0
v0.22.1
v0.22.0
What's Changed
Added
-
Support for configuration compatible with ECS log format by @pamburus in #104
- Added support for predefined field names that can match fields in nested objects when used with dot delimiters.
For example, iflog.origin.file.name
is used for a predefined field name, it will match any of the{ "log.origin.file.name": "app.py" }
{ "log": { "origin.file.name": "app.py" } }
{ "log": { "origin": {"file.name": "app.py" } } }
{ "log": { "origin": {"file": {"name": "app.py" } } } }
- etc.
- Added predefined
caller-file
andcaller-line
fields for separate processing of file name and line number.
Example output
23-11-02 08:09:10.423 |INF| __main__: backup for database bar in foo is already done today application='backup-rds' ecs={ version='1.6.0' } language='python' process={ name='MainProcess' pid=1 thread={ id=140610736142144 name='MainThread' } } ... @ app.py:107
Suggested configuration file for ECS logs is etc/defaults/config-ecs.yaml
These settings have not been added to the default configuration because it is not yet clear how they will affect performance. - Added support for predefined field names that can match fields in nested objects when used with dot delimiters.
Full Changelog: v0.21.0...v0.22.0
v0.21.0
What's Changed
Added
- Option
--raw
to request output of raw source JSON messages instead of formatted messages by @pamburus in #101
Changed
- Flag
-r
that previously served as a shortcut for--raw-fields
is now a shortcut for--raw
option by @pamburus in #101
Other
Full Changelog: v0.20.0...v0.21.0
v0.20.0
What's Changed
Added
- Option to sort messages by timestamp by @pamburus in #43
- Follow mode with message sorting by timestamp by @pamburus in #59
- Support for
HL_CONFIG
environment variable by @pamburus in #89 - More log level values to match in default config by @Jellyfrog in #82
- Instruction how to install on Arch Linux by @k2s in #91
- Universal binary for macOS by @pamburus in #71
- Static build for windows by @pamburus in #50 and #51
- New themes
universal
anduniversal-blue
by @pamburus in #55
Changed
- Removed lower-casing of field keys by @pamburus in #60
- Changed default field key value separator back to equal sign by @pamburus in #53
- Changed default theme to
universal
by @pamburus in #56 - Changed info level color in one-dark themes to cyan by @pamburus in #54
- Case is now ignored in predefined field keys by @pamburus in #96
Fixed
- Command line options
-h
and-l
are now compatible with older versions by @pamburus in #47 - Fixed archive publishing for windows by @pamburus in #72
- Fixed accidental archive type change for windows by @pamburus in #73
- Fixed field key value separator style for nested objects by @pamburus in #75
- Updated time zone identifier column name in wikipedia article references by @pamburus in #83
- Fixed filtering by fields in case number of fields is greater than 32 by @pamburus in #94
New Contributors
- @Jellyfrog made their first contribution in #82
- @k2s made their first contribution in #91
Full Changelog: v0.15.2...v0.20.0