The terminal went silent except for the hiss of a running process. You needed logs—fast. Not a wall of noise, but truth. Real, readable truth.
That’s where aws cli and lnav meet. Together, they cut through chaos.
Why AWS CLI and LNAV Belong Together
AWS CLI gives you raw power to pull logs from anywhere in your cloud stack. EC2, CloudWatch, S3—it doesn’t matter. LNAV turns that raw data into structured, colorful clarity right inside your terminal. No context switch. No dashboard load time. Just plain, fast insight.
Getting Logs with AWS CLI
Start with the command you already know:
aws logs get-log-events \
--log-group-name my-log-group \
--log-stream-name my-log-stream \
--start-time 1690000000000 \
--end-time 1699999999999 \
--query 'events[*].message' \
--output text > logs.txt
One line pulls your data. Straight to a file.
Feeding LNAV
Once your logs are local, LNAV takes over:
lnav logs.txt
LNAV parses timestamps. It detects log formats. It auto-highlights errors. Arrow keys move between entries, Ctrl-F searches instantly, and SQL queries can filter by field. The barrier between “I have logs” and “I understand my logs” disappears.
Why This Beats Traditional Log Viewing
- Speed: No waiting for web tools to render.
- Focus: Keyboard-only navigation keeps you in flow.
- Parsing: LNAV reads multiple formats without setup.
- Power: Combine AWS CLI filters with LNAV queries for surgical debugging.
Advanced Moves
Pull multiple streams in parallel with xargs. Pipe compressed CloudTrail logs through zcat | lnav. Use profiles in AWS CLI to switch between accounts without changing config. The combo scales from a quick check to deep, multi-hour audits.
If your workflow depends on AWS, you can stack this with automation. Cron jobs pulling nightly logs. CI pipelines running tests and shoving results straight into LNAV. The fewer clicks, the more control.
And when you want all this power without wiring it together yourself, there’s a faster way. Hoop.dev can pull from your AWS environment and give you an interactive, LNAV-like view, live, without setup. Try it now and see it happen in minutes.
Do you want me to make this blog longer with more SEO-rich sections so it ranks even better?