> -----Original Message-----
> From: [email protected] [mailto:rsyslog-
> [email protected]] On Behalf Of [email protected]
> Sent: Thursday, October 06, 2011 12:29 AM
> To: rsyslog-users
> Subject: Re: [rsyslog] ifdef (loghost) in rsyslog.conf
> 
> On Wed, 5 Oct 2011, Lu, Victor  wrote:
> 
> > Hi there,
> >
> > One of the requirement we got is to migrate the log facilities and
> files in syslog.conf  to rsyslog,conf without any change.  But I found
> the following ifdef statements are not recognized by rsyslogd. It
> always comes back with syntax error.
> >
> > # 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                                      *
> > )
> >
> > Is there a way to convert them in rsyslog understandable language?
> 
> what you are asking for is for rsyslog to look at an environment
> variable
> from within the config file. As far as I know there is no way to do
> this.
> 
> What I would do is to create two versions of your config file (one if
> you
> are a loghost and one if you are not) and then have some external
> config
> management tool use the appropriate config.
> 
> out of curiosity, what syslog daemon were you using before? I did not
> know
> of any that would allow you to do this sort of thing.

Same question here, I never saw this construct.

Anyhow: I think it should not be too hard to add capabilities to support what
you need. Unfortunately, I am currently quite busy with paid work. If this is
for your company, you may consider purchasing a support contract or
sponsoring the development of such a feature. If you use rsyslog for profit,
that route is probably far less expensive than using a lot of time to tweak
the config.

Rainer
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com

Reply via email to