Results 1 to 3 of 3
hello
I use the programm swatch to display the syslog in a shell in realtime. Now, syslog show a lot of infos (eg. firewall-logs) which I don't want. I want ...
- 10-07-2007 #1Just Joined!
- Join Date
- Aug 2007
- Posts
- 28
pipe-filter for streams
hello
I use the programm swatch to display the syslog in a shell in realtime. Now, syslog show a lot of infos (eg. firewall-logs) which I don't want. I want to filter out eg. the MAC-Address etc.
I tried this as follow:
swatch | sed 's/MAC\=.*?\ //g'
it seems, sed don't know not-greedy quantifiers... what should I do? I want to remove from the Word MAC all until the next whitespace...
any hint?
thank you.
raphael
- 10-07-2007 #2
This is a hack, but it will work:
If you terminate with something more complex than a single space, then you truly need non-greedy pattern matching, so (I believe) you need to punt. The following is portable in the sense that if you have Perl, then this will work for all versions of Perl:Code:swatch | sed 's/MAC\=[^ ]*\ //g'
Hope this helps.Code:swatch | perl -pe 's/MAC\=.*?\ //g'
- 10-08-2007 #3Just Joined!
- Join Date
- Aug 2007
- Posts
- 28
Solved
thank you very much. this is exactly what I wanted!
greetings, raphael


Reply With Quote