sig: Interactive grep for streaming data
You're watching a Kubernetes pod's logs fly by and there—did you see that error message? Gone. Buried under twenty lines of debug output while you were typing your grep pattern.
What It Is
sig is interactive grep that works while data streams past. Think of it as grep with a search box that updates results in real-time, designed for the modern reality of tailing logs, monitoring streams, and debugging live systems.
Unlike traditional grep where you write a pattern and hope you caught everything, sig lets you adjust your search while the data flows. Type a pattern, see matches instantly, refine it without losing context.
Why It's Worth Your Time
Most of us have been there: kubectl logs -f streaming past while you're desperately trying to craft the perfect grep pattern. By the time you get it right, the interesting stuff scrolled away three screens ago.
sig flips this around. It buffers incoming data and lets you search through it interactively. Change your search terms on the fly. Hit Ctrl+R to re-run the original command if you missed something. Switch to "archived mode" to dig through what already passed.
The killer feature: when you're using --cmd, sig can re-execute your original command. Missed that error while you were thinking? Ctrl+R runs kubectl logs again with fresh data.
Hands On
Install it the easy way:
# Homebrew
brew install ynqa/tap/sigrs
# Or Cargo if you're into Rust
cargo install sigrs
# Arch users get the short name
pacman -S sig
Basic usage pipes any stream through sig:
# Traditional way - pray you catch the good stuff
kubectl logs -f my-pod | grep "error"
# sig way - adjust your search while it streams
kubectl logs -f my-pod | sig
# Even better - let sig handle the command
sig --cmd "kubectl logs -f my-pod"
That last approach is the sweet spot. Now you can hit Ctrl+R anytime to re-run the kubectl command with fresh data. No more "damn, I should have started sig before running that."
Type to search. Results update immediately. Ctrl+S pauses the stream if things are moving too fast. Ctrl+F switches to archived mode where you can scroll through buffered lines like a normal text viewer.
The archived mode is clever. For static input (like cat file.log | sig), it switches automatically when it hits EOF. For streaming input, you control when to freeze time and dig through what you've collected.
Honest Verdict
sig solves a real problem well. If you spend time watching log streams, debugging services, or monitoring anything that produces continuous output, this will save you frustration.
The interactive search feels natural once you try it. No more frantically typing | grep -i some-term while logs scroll past. The command re-execution is genuinely useful for those "I need to see that again" moments.
Downsides? It's another tool to learn when grep usually works fine. The Rust dependency means a bigger install than some minimalists prefer. And if you're dealing with truly massive log volumes, the buffering might hit memory limits.
But for normal debugging sessions, monitoring a handful of services, or working through application logs, sig hits the sweet spot between power and simplicity.
Go Try It
Start with something you already tail regularly:
sig --cmd "tail -f /var/log/system.log"
Watch how the search box responds as you type. Hit Ctrl+R to refresh the stream. Try Ctrl+F to explore archived mode.
Once you've felt how interactive search works on live data, you'll find excuses to use it.
More tools and techniques at justmeandlinux.com
Compiled by AI. Proofread by caffeine. ☕