Operating System - HP-UX
1830212 Members
1604 Online
109999 Solutions
New Discussion

Re: Syslog.conf Question?

 
joe_91
Super Advisor

Syslog.conf Question?

Team:

I have a need to redirect some third party stuff ( currently writing to syslog) to another log file. I put a -v option to syslog and found that the following services to be redirected to a different log file.
6B,2E,4B,3B,2B. Please help me to redirect these services used by the third party s/w to be redirected.

Thanks
Joe.
4 REPLIES 4
Paula J Frazer-Campbell
Honored Contributor

Re: Syslog.conf Question?

Joe

This may help :-

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


Paula
If you can spell SysAdmin then you is one - anon
Rita C Workman
Honored Contributor

Re: Syslog.conf Question?

You could, as was mentioned, just grep your syslog file for these conditions. Here's a shortform of something to remove those 6b,2e...and only write out to temp what is left.

cat ~/syslog.log | egrep -v -i '6b|2e|4b|3b|2b' > ~/syslog.temp
mv ~/syslog.temp > ~/syslog.log

..But..if it's a third party software, I'd be talking to that vendor to have them create 'their' own log in an appropriate f/s !!!

Just a thought,
Rita


Rita C Workman
Honored Contributor

Re: Syslog.conf Question?

Woops...I'm wiping them out. You just wanted to redirect...sorry...just add the following to be the first line:

cat ~/syslog.log | egrep -i '6b|2e|....' > ~/syslog.3pty
Now the other 2 lines...

This will put those entries to another file syslog.3pty for you to read...and then clean up your syslog.

Sorry for not reading closer..
Rita
MANOJ SRIVASTAVA
Honored Contributor

Re: Syslog.conf Question?

Hi Joe


Steps should be like this

1. make a copy of syslog.
2. grep on the fields you want to take out and o/p to differnt files.


you can also edit /sbin/init.d/syslogd to redirect o/p to some other file , but I prefer that you sont not modify that system script ans use the syslog file itself.


Manoj Srivastava