Is that possible to use grep
on a continuous stream?
What I mean is sort of a tail -f
command, but with grep
on t
you may consider this answer as enhancement .. usually I am using
tail -F | grep --line-buffered -A 3 -B 5
-F is better in case of file rotate (-f will not work properly if file rotated)
-A and -B is useful to get lines just before and after the pattern occurrence .. these blocks will appeared between dashed line separators
But For me I prefer doing the following
tail -F | less
this is very useful if you want to search inside streamed logs. I mean go back and forward and look deeply