Filter Kubernetes JSON logs interactively
Make container JSON readable, stack service and error filters, then undo one condition while your investigation stays open.
CLI tools / workflow comparison
Compare interactive log investigation with shell filtering and JSON transformation, using the same small example.
Updated October 27, 2026 · Flik 0.1.0 · synthetic examples · macOS and Linux
grep, jq and Flik are useful at different points in a log workflow. The practical choice depends on whether you want a repeatable pipeline or an investigation in which the next question changes after every result. This guide compares that workflow without claiming that Flik implements jq expressions.
Download the five-record JSON Lines sample. It contains gateway, payment and worker messages. Two records have both service=payment and level=error.
jq -c 'select(.service == "payment" and .level == "error")' app.jsonlThis produces two matching JSON objects. It is a good fit for shell scripts, automated reports and pipelines where the transformation is known in advance. jq can also construct new objects and reshape JSON; those capabilities are outside Flik’s query language.
flik --table --fields timestamp,service,level,message app.jsonlPress 3 and add service:payment, then add level:error. You see the same two error messages in an interactive view. Press x to remove only the latest filter: the payment warning becomes visible again without reopening the file. Use 6 to change columns and v to inspect distinct field values.
| Task | Useful starting point |
|---|---|
| Find a literal string in many text files | grep or another text-search tool |
| Transform JSON and feed a scripted pipeline | jq |
| Refine several log filters while retaining context | Flik |
| Follow a stream and change visible fields interactively | Flik with stdin input |
| Run an unattended, reproducible JSON transformation | jq and a shell script |
Text searches can match a word in any part of a line; structured filters target a named field when the format exposes it. If the error still does not explain the incident, use //error to retain the preceding line or open the selected result’s context with Ctrl+G. For request chains, inspect a correlation ID across two files instead of assuming adjacent lines belong together.
Flik is a local, interactive terminal application for macOS and Linux. It does not execute jq programs, manage central log retention or replace an unattended log-processing job. Keep automated transformations in the tools that already express them clearly, and use the interactive workspace when each result changes the next question.
Download a ready-to-run macOS or Linux release, open a synthetic sample and repeat the investigation locally.
Download Flik →Make container JSON readable, stack service and error filters, then undo one condition while your investigation stays open.
Use smart find to keep the events surrounding an error, refine the result and return to the original file order.
Filter failed Nginx requests, count occurrences by hour and distinguish HTTP statuses from error-log severity.