[opensuse] Syntax forc combining tailf and grep
I am viewing the /var/log/messages file and as there are alot of entries in it and it is constantly being updated, I wondered if there was a way to display an updating grep on the file without having to create a script and corresponding cron entry to run every time the file is updated ie #tailf /var/log/messages|grep backup Just wondering if its possible. -- ======================================================================== Using SuSE 9.2 Professional with KDE and Mozilla Mail 1.7.13 Linux user # 229959 at http://counter.li.org ======================================================================== -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2006-11-28 04:06, Hylton Conacher(ZR1HPC) wrote:
#tailf /var/log/messages|grep backup
Yes, that works. -- The best way to accelerate a computer running Windows is at 9.81 m/s² -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Tuesday 2006-11-28 at 12:06 +0200, Hylton Conacher(ZR1HPC) wrote:
I am viewing the /var/log/messages file and as there are alot of entries in it and it is constantly being updated, I wondered if there was a way to display an updating grep on the file without having to create a script and corresponding cron entry to run every time the file is updated ie #tailf /var/log/messages|grep backup
Just wondering if its possible.
Of course it works. Did you try? :-) Also, you can taylor syslog-ng to create a separate log file filtered with what you want in it. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFFbBoAtTMYHG2NR9URAsY2AJ4ghyXNLS+c6Jpi+aJvR4ageNv4QwCffB/7 q1o1gOU8etjh1A7R3wdhM8s= =vIlx -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Carlos E. R. wrote:
The Tuesday 2006-11-28 at 12:06 +0200, Hylton Conacher(ZR1HPC) wrote:
I am viewing the /var/log/messages file and as there are alot of entries in it and it is constantly being updated, I wondered if there was a way to display an updating grep on the file without having to create a script and corresponding cron entry to run every time the file is updated ie #tailf /var/log/messages|grep backup
Just wondering if its possible.
Of course it works. Did you try? :-)
:( No I didn't :( On a grep cmd of the /var/log/messages file I saw there were many entries that came back. I thought that with the above command incorporating tailf that I would get the last 10 or so entries. When the cmd gave me nothing, without backung up, I prefered to err on the side of caution, and ask here first. I have now executed the command and initiated a backup and I am getting the display I wanted, bit not what I thought I would get.
Also, you can taylor syslog-ng to create a separate log file filtered with what you want in it.
Another time far far away....:) -- ======================================================================== Using SuSE 9.2 Professional with KDE and Mozilla Mail 1.7.13 Linux user # 229959 at http://counter.li.org ======================================================================== -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2006-11-29 12:59, Hylton Conacher(ZR1HPC) wrote:
Carlos E. R. wrote:
<snip>
Also, you can taylor syslog-ng to create a separate log file filtered with what you want in it.
Another time far far away....:)
SuSE uses just such a filter to create the separate firewall log and exclude firewall entries from /var/log/messages. So, when you do wish to try this, you have an excellent working example already. Make changes to file /etc/syslog-ng/syslog-ng.conf.in, and run "SuSEconfig --module syslog-ng" when you are done. (Insert customary caution about backing stuff up here :-) ) -- The best way to accelerate a computer running Windows is at 9.81 m/s² -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (3)
-
Carlos E. R.
-
Darryl Gregorash
-
Hylton Conacher(ZR1HPC)