I have this line that appears every minute in my log file:
2016-03-29 21:52:46,226 INFO 200 GET /api/ping (0.0.0.0) 0.34ms
I want to tail
this log file without showing these lines.
I tried:
tail -f log.txt | grep -v "ping"
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityYou could do something like this:
tail -F ~/Your.log | while read LINE;do
if [[ ! "$LINE" =~ "ping" ]]; then
echo $LINE
done
fi
done
echo "..GET /api/ping (0.." | grep -v "ping"
yelids a 1 result with no matches.tail -n 0 -f test | grep -v "ping"
and run this in another terminalecho "..GET /api/ping (0.." >> test
still result in no output. I've tested this on 4 different unix distros, and cygwin on windows. All have the same expected behavior.