1

I run syslog-ng on several platforms with the default /etc/syslog-ng/syslog-ng.conf, as well as an independent /etc/syslog-ng/conf.d/myconfig.conf

In that specifc configuration I would like to reuse s_src from syslog-ng.conf, defined there as

source s_src {
       system();
       internal();
};

Unfortunately there are two problems which complicate my configuration:

  • s_src is the default name on Debian, it is s_sys on CentOS (for the same source)
  • it is not possible to have twice internal() as a source in a config (syslog-ng log shows Multiple internal() sources were detected, this is not possible;)

I am currently stuck with managing two identical sets of config files due to that single difference. Therefore:

  • is it possible to conditionally use one source or another, depending on the platform (unfortunately, the platform is not part of the ENV variables)?
  • or is a "soft-fail" possible - that is making so that syslog-ng does not stop parsing the configuration file upon an error? (in that case I would simply have two log entries with both sources, of which one would always fail for a given platform)
WoJ
  • 3,607
  • 9
  • 49
  • 79

1 Answers1

1

It is possible to reset a source and recreate a common one using internal() again:

@define allow-config-dups 1
source s_src {};
source s_sys {};
source s_common {
       system();
       internal();
};
WoJ
  • 3,607
  • 9
  • 49
  • 79