Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--line-buffered doesn't work #121

Open
pmorch opened this issue Apr 29, 2021 · 3 comments
Open

--line-buffered doesn't work #121

pmorch opened this issue Apr 29, 2021 · 3 comments

Comments

@pmorch
Copy link

pmorch commented Apr 29, 2021

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
@johanhaleby
Copy link
Owner

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!

@bootandy
Copy link

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

@bootandy
Copy link

Update: Fixed my problem by remembering to add '--line-buffered' to grep on the end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants