[Gllug] Excluding matches with grep
Dylan
dylan at dylan.me.uk
Sun Jan 25 18:35:42 UTC 2004
Hi all,
I'm trying to filter some entries from a logfile to a text file.
Specifically, I want all firewall entries, except those which I can
already explain. For example - I don't want martian packets. So,
issuing:
cat /var/log/gateway.messages | grep SuSE-FW > fw.txt
gets all the firewall messages, then I can re-grep to extract particular
things by other patterns, but ideally I'd like to be able to do:
cat /var/log/gateway.messages | grep {reg-exp to match all lines with
SuSE-FW except (those with martian OR SPT=53 OR ...)} > fw.txt
Is this possible with grep?
Cheers
Dylan
--
"They that can give up essential liberty to obtain a little
temporary safety, deserve neither liberty nor safety."
-Benjamin Franklin
--
Gllug mailing list - Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
More information about the GLLUG
mailing list