Skip to main content

Why lnav?

Reading raw JSONL files with grep 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

Install the docker-agent-tail format

The lnav format is auto-installed the first time you run docker-agent-tail. No manual setup needed. To manually install or reinstall:
This installs a format definition that teaches lnav how to parse the JSONL fields (ts, container, stream, level, message).

Usage

The easiest way to view logs is with the lnav subcommand:
You can also call lnav directly:

Key Features

Filter by log level

Use lnav’s built-in level filtering to focus on errors or warnings:
Or filter to show only specific levels:

Filter by container

Show logs from a specific container:

SQL queries

lnav supports SQL queries against your log data:
Search across all logs with regex:

Timeline view

Press t 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:
AI coding agents (Claude Code, Cursor, etc.) should use lnav -n -c instead of the interactive TUI. This gives them full SQL access to structured log data without needing a terminal.

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