kubetail
kubetail copied to clipboard
--line-buffered doesn't work
I have a container that spits out a log entry every 5 seconds which is annoying. I want to kubetail $args | grep -v annoying
but now new output doesn't show up immediately, but shows up in chunks when the buffer fills up. Conclusion: --line-buffered
doesn't work.
This doesn't work:
kubetail container --line-buffered | grep -v somethingelse
But this does:
kubectl logs -l app.kubernetes.io/instance=myinstance -f | grep -v somethingelse
Using
kubetail --version
1.6.13-SNAPSHOT
Hmm ok maybe it has broken somehow. Really hard to very everything when there are no tests unfortunately. If you're up for it we would really appreciate a PR. If so I can make a new release asap!
I have just encountered this too. But for me it only occurs when I'm also using the 'jq' flag and piping that into grep.
kubectl logs -l app.kubernetes.io/instance=myinstance -f --jq '.LogLevel + " "+ .Message + " "+.Exception' | grep -v somethingelse
Update: Fixed my problem by remembering to add '--line-buffered' to grep on the end.