Why lnav?
Reading raw JSONL files withgrep and jq works, but you lose context. lnav gives you a real-time, interactive view of your logs — color-coded levels, instant filtering, SQL queries, and a timeline view — all in your terminal.
docker-agent-tail includes a built-in lnav format definition that’s auto-installed on first run. No configuration, no schema files to manage.
Setup
Install lnav
- macOS
- Linux
Install the docker-agent-tail format
The lnav format is auto-installed the first time you rundocker-agent-tail. No manual setup needed.
To manually install or reinstall:
ts, container, stream, level, message).
Usage
The easiest way to view logs is with thelnav subcommand:
Key Features
Filter by log level
Use lnav’s built-in level filtering to focus on errors or warnings:Filter by container
Show logs from a specific container:SQL queries
lnav supports SQL queries against your log data:Regex search
Search across all logs with regex:Timeline view
Presst to switch to the timeline/histogram view, which shows log density over time — useful for spotting bursts of errors.
Non-interactive mode (for scripts and AI agents)
lnav’s interactive TUI doesn’t work in non-interactive shells (CI, scripts, AI agents). Use-n (non-interactive) with -c to run commands and get output to stdout:
Multiple commands
Chain multiple-c flags to build pipelines:
Level Normalization
docker-agent-tail normalizes log levels from various formats into canonical values that lnav understands:
This means logs from MongoDB (
s:"I"), Node.js (level:"info"), Python (levelname:"WARNING"), and other frameworks all get consistent color-coded levels in lnav.
Learn More
- lnav documentation
- lnav hotkeys reference
- CLI Reference for all docker-agent-tail options