Install hl Log File Viewer on Ubuntu 26.04

Install hl Log File Viewer on Ubuntu 26.04

The hl is a command-line log viewer that simplifies this process by converting JSON and logfmt log entries into a cleaner, human-readable format directly in the terminal. It is designed for working with structured logging data, making fields such as timestamps, levels, and key-value pairs easier to inspect during debugging and system monitoring. This tutorial shows how to install hl log file viewer on Ubuntu 26.04.

Install hl

Download the latest release archive from GitHub repository and extract the hl executable into /usr/local/bin:

curl -sSL https://github.com/pamburus/hl/releases/latest/download/hl-linux-x86_64-gnu.tar.gz \
  | sudo tar xz -C /usr/local/bin hl

Confirm that hl has been installed successfully by displaying its version:

hl --version

Testing hl

Create a sample log file containing different message levels for testing:

echo 'time=2026-08-02T10:15:32Z level=info service=api msg="Starting server"
time=2026-08-02T10:15:33Z level=debug service=api msg="Loading config"
time=2026-08-02T10:15:34Z level=warn service=api msg="Disk usage high" percent=85
time=2026-08-02T10:15:35Z level=error service=api msg="Database connection failed"' > sample.log

View the log file with hl:

hl sample.log

The viewer highlights different parts of the log content, helping quickly differentiate informational messages, warnings, and errors during analysis.

View log file using hl on Ubuntu

Uninstall hl

When hl is no longer required, remove the installed executable from the system path:

sudo rm -rf /usr/local/bin/hl

Leave a Comment

Cancel reply

Your email address will not be published.