SkillAgentSearch skills...

Hl

A fast and powerful log viewer and processor that converts JSON logs or logfmt logs into a clear human-readable format.

Install / Use

/learn @pamburus/Hl

README

hl [![Build Status][ci-img]][ci] [![Coverage Status][cov-img]][cov] [![Release][release-img]][release]

banner

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.

Features overview

  • Automatic Pager Integration: Automatically integrates with a pager for enhanced convenience, defaulting to less if available, but fully supporting any compatible pager.
  • Log Streaming Mode: Enable log streaming with the -P flag, which disables the pager.
  • Field-Based Filtering: Filter log records by key/value pairs using the -f option, with support for hierarchical keys.
  • Level Filtering: Easily filter logs by level with the -l option.
  • Timestamp Range Filtering: Filter logs by timestamp range using the --since and --until options with intuitive formats:
    • RFC-3339 timestamp format.
    • Current configured timestamp output format (via the -t option or environment variable).
    • User-friendly shortcuts like today, yesterday, friday, or relative offsets such as -3h or -14d.
  • Field Visibility Control: Quickly hide or reveal specific fields using the -h option.
  • Empty Field Hiding: Automatically hide empty fields with the -e flag.
  • Field Expansion: Control multi-line field and message formatting with the -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.
  • High-Speed Message Sorting: Achieve lightning-fast message sorting with automatic indexing via the -s flag.
    • Performs the initial scan at approximately 2 GiB/s, enabling rapid filtering by timestamp and level without re-scanning.
    • Efficiently handles hundreds of local files totaling hundreds of gigabytes.
    • Reindexes large, growing files at speeds up to roughly 10 GiB/s by skipping unmodified blocks.
  • Live Follow Mode: Use the -F flag for live, timestamp-sorted message updates across multiple sources, with a preview of recent messages via the --tail option.
  • Complex Query Support: Construct custom queries with logical conditions (AND/OR) and additional advanced filtering options.
  • Non-JSON Prefix Handling: Process logs with non-JSON prefixes using the --allow-prefix flag.
  • Timezone Flexibility: Displays timestamps in UTC by default while allowing effortless timezone switching with the -Z option or local timezone adjustments using the -L flag.
  • Customizability and Themes: Fully customizable through configuration files and environment variables, with support for easy theme switching and custom themes.

Performance comparison chart

Performance comparison with humanlog, hlogf and fblog on a 2.3 GiB log file

performance chart

Installation options

macOS

  • Install using homebrew on macOS

    brew install hl
    
<details> <summary>Other options</summary>
  • Download and extract using curl and tar on macOS

    curl -sSfL https://github.com/pamburus/hl/releases/latest/download/hl-macos.tar.gz | tar xz
    
  • Install using cargo

    cargo install --locked --git https://github.com/pamburus/hl.git
    
  • Download latest release from download page

</details>

Linux

  • 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 xz
    
  • Install hl package from Arch Linux extra repository

    pacman -S hl
    
<details> <summary>Other options</summary>
  • Download 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 xz
    
  • Install using cargo

    cargo install --locked --git https://github.com/pamburus/hl.git
    
</details>

Windows

  • Install 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 LESS environment variable to -R --mouse.

[!IMPORTANT] Currently, hl does 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 with hl and 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 install hl by running scoop install hl, it already installs less automatically as a dependency. Just make sure you do not have any other conflicting installations by running where less in cmd or Get-Command less in powershell.

<details> <summary>Other options</summary>
  • Install using cargo

    cargo install --locked --git https://github.com/pamburus/hl.git
    
</details>

NixOS

  • Run using nix

    nix run github:pamburus/hl
    

    or binary package

    nix run github:pamburus/hl#bin
    

    or install with nix profile:

    nix profile add github:pamburus/hl
    

    or binary package

    nix profile add github:pamburus/hl#bin
    
  • Install the package from source using nix-flakes

    <details> <summary>Example how to update nix configuration</summary>
    {
      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}
              ];
            })
          ];
        };
      };
    }
    
    </details>
  • Install the package with pre-built binaries using nix-flakes

    <details> <summary>Example how to update nix configuration</summary>
    {
      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
              ];
            })
          ];
        };
      };
    }
    
    </details>

Examples

Screenshot

<p align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/pamburus/hl-extra/37b444fcd812563963631071af581445851aa86e/screenshot/uni/dark.svg" /> <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/pamburus/hl-extra/37b444fcd812563963631071af581445851aa86e/screenshot/uni/light.svg" /> <img alt="screenshot" src="https://hl-uni.tiiny.site/dark.svg" /> </picture> </p>

See other screenshots

Features and usage

Concatenation of multiple log files

  • Concatenate all log files

    Command

    hl *.log
    

    Concatenates and displays all *.log files found in the current directory.

Support for compressed (bzip2, gzip, xz, zstd) log files

  • 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 compressio

View on GitHub
GitHub Stars3.0k
CategoryDevelopment
Updated9h ago
Forks61

Languages

Rust

Security Score

100/100

Audited on Mar 27, 2026

No findings