I want to tail -f
my logs. However, I want to filter out everything that has the words:
"ELB", "Pingdom", "Health"
greplinuxloggingtailunix
I want to tail -f
my logs. However, I want to filter out everything that has the words:
"ELB", "Pingdom", "Health"
Best Answer
I don't know about using awk instead of grep, but this works for me:
EDIT: As dmourati and Caleb pointed out, you could also use
egrep
instead ofgrep -E
for convenience. On some systems this this will be an link to the same binary, in others a copy of it supplied by the grep package. Either way it lives as an alternative to the-E
switch. However, according to the GNU grep man page:Since they are synonymous commands, it comes down to preference unless you don't have egrep at all. However for forward compatibility it is recommended to use the
grep -E
syntax since the other method is officially deprecated.