这是一个快速而强大的日志查看器和处理器,可将 JSON 日志或 logfmt 日志转换为清晰易读的格式。
High-performance log viewer and processor that transforms logs in JSON and logfmt formats into a human-readable output. Built with efficiency in mind, it enables quick parsing and analysis of large log files with minimal overhead.
-P flag, which disables the pager.-f option, with support for hierarchical keys.-l option.--since and --until options with intuitive formats:-t option or environment variable).today, yesterday, friday, or relative offsets such as -3h or -14d.-h option.-e flag.-x option:never: Compact single-line output with escaped newlines.inline: Preserve newlines as-is in the output.auto: Automatically expand fields containing multi-line content.always: Expand all fields into structured multi-line format.-s flag.-F flag for live, timestamp-sorted message updates across multiple sources, with a preview of recent messages via the --tail option.--allow-prefix flag.-Z option or local timezone adjustments using the -L flag.Install using homebrew on macOS
brew install hlDownload and extract using curl and tar on macOS
curl -sSfL https://github.com/pamburus/hl/releases/latest/download/hl-macos.tar.gz | tar xzInstall using cargo
cargo install --locked --git https://github.com/pamburus/hl.gitDownload latest release from download page
Download and extract using curl and tar on Linux (x86_64)
curl -sSfL https://github.com/pamburus/hl/releases/latest/download/hl-linux-x86_64-musl.tar.gz | tar xzInstall hl package from Arch Linux extra repository
pacman -S hlDownload and extract using curl and tar on Linux (arm64/aarch64)
curl -sSfL https://github.com/pamburus/hl/releases/latest/download/hl-linux-arm64-musl.tar.gz | tar xzInstall using cargo
cargo install --locked --git https://github.com/pamburus/hl.gitInstall from Scoop
scoop bucket add pamburus https://github.com/pamburus/scoop-bucket.git
scoop install hl[!TIP] It is recommended to use Windows Terminal for better experience.
[!TIP] To make mouse scrolling work in the less pager, set the
LESSenvironment variable to-R --mouse.
[!IMPORTANT] Currently,
hldoes not provide a built-in pager and relies on external pagers such as less. However, the build for Windows referenced on the original download page and distributed in the WinGet package manager does not work as expected. The authors state that they have not tested or verified this build and suggest that you use it at your own risk. Unfortunately, this build breaks some ANSI escape sequences and does not work properly withhland many other programs that use ANSI escape sequences for colors and styles. It is recommended to install less from the Scoop or Chocolatey package manager. If you are using Scoop and installhlby runningscoop install hl, it already installs less automatically as a dependency. Just make sure you do not have any other conflicting installations by runningwhere lessin cmd orGet-Command lessin powershell.
Install using cargo
cargo install --locked --git https://github.com/pamburus/hl.gitRun using nix
nix run github:pamburus/hlor binary package
nix run github:pamburus/hl#binor install with nix profile:
nix profile add github:pamburus/hlor binary package
nix profile add github:pamburus/hl#binInstall the package from source using nix-flakes
Example how to update nix configuration{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
hl.url = "github:pamburus/hl";
};
outputs = {nixpkgs, hl, ...}:
let
system = "x86_64-linux";
in
{
# this is just an example!
nixosConfigurations.yourHost = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
({...}: {
environment.systemPackages = [
hl.packages.${system}
];
})
];
};
};
}Install the package with pre-built binaries using nix-flakes
Example how to update nix configuration{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
hl.url = "github:pamburus/hl";
};
outputs = {nixpkgs, hl, ...}:
let
system = "x86_64-linux";
in
{
# this is just an example!
nixosConfigurations.yourHost = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
({...}: {
environment.systemPackages = [
hl.packages.${system}.bin
];
})
];
};
};
}
</picture>
See other screenshots
Concatenate all log files
Command
hl *.log Concatenates and displays all *.log files found in the current directory.
Concatenate all log files including compressed log files
Command
hl $(ls -tr /var/log/example/*.{log,log.gz,log.zst,s}) Concatenates and displays all *.log, *.log.gz, *.log.zst and *.s (will detect compression) files found in /var/log/example/.
Use the default pager with the default parameters
Command
hl example.log Automatically opens less pager with the default parameters.
Override options for default pager
Command
LESS=-SR hl example.log Opens less pager with disabled line wrapping.
Use custom pager
Command
PAGER="most -w" hl example.log Opens most pager with -w option.
Errors only
Command
hl -l eDisplays only error log level messages.
Errors and warnings
Command
hl -l wDisplays only warning and error log level messages.
Errors, warnings and informational
Command
hl -l iDisplays all log messages except debug level messages.
Command
tail -f example.log | hl -P Tracks changes in the example.log file and displays them immediately.
Flag -P disables automatic using of pager in this case.
Command
hl example.log --filter component=tsdb Displays only messages where the component field has the value tsdb.
Command
hl example.log -f component!=tsdb -f component!=uninteresting Displays only messages where the component field exists and has a value other than tsdb or uninteresting.
Command
hl example.log -f provider~=string Displays only messages where the provider field contains the string sub-string.
Command
hl example.log -f 'provider!~=string' Displays only messages where the provider field exists and does not contain the string sub-string.
Command
hl example.log -f 'request.method?!=GET' Displays only messages where the request.method field does not exist or exists and is not equal to GET. In JSON messages, this also matches composite fields, e.g., {"request":{"method":"POST"}}.
Com
暂无开放 Issues,或尚未同步最近议题。