Currently I'm trying to tail a log but only showing the lines that has some keywords. Currently I'm using
tail -F file.log | grep -ie 'error\|fatal\|exception\|shutdown\|started' and I'm getting the expected results: (for example)
10:22 This is an error 10:23 RuntimeException: uncaught problem I also want to exclude lines that contain a <DATATAG>, even if the keywords slipped into it, because it contains a lot of binary data that clutters my log. I'm then trying to add to the pipe another grep that excludes the tag:
tail -F file.log | grep -ie 'error\|fatal\|exception\|shutdown\|started' | grep -vF '<DATATAG>' However, this time no lines appear, not even the previous ones that has 'error'/'exception' but not <DATATAG>. When I tried the excluding grep alone:
tail -F file.log | grep -vF '<DATATAG>' all lines appear, including those that have 'error'/'exception'.
Am I doing something wrong?
tail -F file.log | awk '!/<DATATAG>/ && tolower($0)~/error|fatal|exception|shutdown|started/'.