parse /etc/syslog.conf file
Hello there,
Guys I've got an issue and I need a hint...I have to create a sh script which parse /etc/syslog.conf file (under solaris) and need to get all path accordingly to all logs configured in there. If anybody knows more about this please let me know. Thanks . |
What have you tried so far? What are the contents of /etc/syslog.conf?
|
About trying awk? Pretty easy to parse with AWK -- I'd check to see if awk is linked to oawk or nawk and use nawk if it's linked to oawk but other than that it ought to be straightforward.
Hope this helps some. |
Hello,
The content of the file is bellow.Right now I'm trying to find what to use..awk or sed, i don't have so much experience with these tools and I need some ideas. I need to get from this config file ALL the paths to log files that are configured , for example /var/adm/messages #ident "@(#)syslog.conf 1.5 98/12/14 SMI" /* SunOS 5.0 */ # # Copyright (c) 1991-1998 by Sun Microsystems, Inc. # All rights reserved. # # syslog configuration file. # # This file is processed by m4 so be careful to quote (`') names # that match m4 reserved words. Also, within ifdef's, arguments # containing commas must be quoted. # *.err;kern.notice;auth.notice /dev/sysmsg *.err;kern.debug;daemon.notice;mail.crit /var/adm/messages *.alert;kern.err;daemon.err operator *.alert root *.emerg * # if a non-loghost machine chooses to have authentication messages # sent to the loghost machine, un-comment out the following line: #auth.notice ifdef(`LOGHOST', /var/log/authlog, @loghost) mail.debug ifdef(`LOGHOST', /var/log/syslog, @loghost) # # non-loghost machines will use the following lines to cause "user" # log messages to be logged locally. # ifdef(`LOGHOST', , user.err /dev/sysmsg user.err /var/adm/messages user.alert `root, operator' user.emerg * ) |
Quote:
|
All times are GMT -5. The time now is 01:35 PM. |