1851852 Members
4157 Online
104062 Solutions
New Discussion

syslog new entry

 
SOLVED
Go to solution
Jannik
Honored Contributor

syslog new entry

Hey,
with dmesg you are can get all new entries with the '-' option.
dmesg -
Is there a utility that will do the same for syslog.log?
jaton
4 REPLIES 4
Christian Gebhardt
Honored Contributor

Re: syslog new entry

Hi

grep "pattern" /var/adm/syslog/syslog.log

Chris
Graham Cameron_1
Honored Contributor
Solution

Re: syslog new entry

I replied to a similar thread recently...

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=317666

-- Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
Shahul
Esteemed Contributor

Re: syslog new entry

Hi,

dmesg - will show the messages since tha last time it was run. I don't think such an option is valid for syslog.log, because it is updated continuously. The only thing you may choose is tail, grep, head..etc or a combination of these.

Or you can write a customized script and put it in cron to do this job.

Good luck
Shahul
Jean-Louis Phelix
Honored Contributor

Re: syslog new entry

hi,

You can use a script like this one :

#!/usr/bin/sh
FILE=$1
comm -23 $FILE $FILE.prev 2>&-
cp $FILE $FILE.prev

Each invocation will give you new lines added, but there is no standard option for doing it with syslog.

Regards.
It works for me (© Bill McNAMARA ...)