Operating System - HP-UX
1834926 Members
2535 Online
110071 Solutions
New Discussion

Re: Filtering just the error messages from syslog.log file

 
Starrynight
Advisor

Filtering just the error messages from syslog.log file

Hello everybody
I would like to know if there is a way to filter only the error messages from syslog.log file.
Thanks in advance
System administrator
4 REPLIES 4
Robin Wakefield
Honored Contributor

Re: Filtering just the error messages from syslog.log file

Hi T?nia,

If you mean "on the fly" filtering to another file, check this current forum thread:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0xf16e87dc4d7dd5118ff00090279cd0f9,00.html

You could always create another entry in syslog.conf to only trap errors and above to another file:

*.err;mail.none /var/adm/syslog/syslog.errors

This will ignore mail entries. Don't forget selector and filename is TAB separated. Then send the syslogd a HUP signal.

Rgds, Robin.
Rita C Workman
Honored Contributor

Re: Filtering just the error messages from syslog.log file

I rather liked Denver's and Kofi's suggestion at this thread.....I implemented it here, and have found it works very well for me. And with this, you can change the email address alert to go to whoever you need when your going to be out....

http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0x0597c3d7fb78d4118fef0090279cd0f9,00.html

Just a thought,
Rita
Emilio Sierra
Advisor

Re: Filtering just the error messages from syslog.log file

Another way:

Just insert the below line in your cron:

01,31 * * * * /usr/sbin/dmesg - >> /mydir/log/fichero.log

This command append the new error messages (only) to fichero.log
Jiri D
Advisor

Re: Filtering just the error messages from syslog.log file

Hi Tania

Try this command:
egrep -i 'fail|error|warn|alert' /var/adm/syslog/syslog.log > /tmp/err.log

Jirid