From 2bc228c6ed952a5f9510fa974e47e27871e87046 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 1 Aug 2007 10:12:40 +0000 Subject: enhanced/renamed $include(config) directive --- doc/rsyslog_conf.html | 51 ++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 40 insertions(+), 11 deletions(-) diff --git a/doc/rsyslog_conf.html b/doc/rsyslog_conf.html index 7fff442e..757aed59 100644 --- a/doc/rsyslog_conf.html +++ b/doc/rsyslog_conf.html @@ -130,18 +130,47 @@ setting does not affect the owner of directories already existing. The parameter is a user name, for which the userid is obtained by rsyslogd on startup and on HUPing. Interim changes to the user mapping are not detected.

$DirOwner loguser

-

Include

+

IncludeConfig

This directive allows to include other files into the main configuration -file. As soon as an include directive is found, the contents of the new file is -processed. Includes can be nested. Please note that from a logical point of view -the files are merged. Thus, if the include modifies some parameters (e.g. -$DynaFileChacheSize), these new parameters are in place for the "calling" -configuration file when the include is completed. To avoid any side effects, do -a $ResetConfigVariables after the $Include. It may also be a good idea to do a -$ResetConfigVariables right at the start of the include, so that the module -knows exactly what it does. Of course, one might specifically NOT do this to -inherit parameters from the main file. As always, use it as it best fits...

-

$Include /etc/some-included-file.conf

+file. As soon as an IncludeConfig directive is found, the contents of the new +file is processed. IncludeConfigs can be nested. Please note that from a logical +point of view the files are merged. Thus, if the include modifies some +parameters (e.g. $DynaFileChacheSize), these new parameters are in place for the +"calling" configuration file when the include is completed. To avoid any side +effects, do a $ResetConfigVariables after the $IncludeConfig. It may also be a +good idea to do a $ResetConfigVariables right at the start of the include, so +that the module knows exactly what it does. Of course, one might specifically +NOT do this to inherit parameters from the main file. As always, use it as it +best fits...

+

$IncludeConfig /etc/some-included-file.conf

+

Directories can also be included. To do so, the name must end on a slash:

+

$IncludeConfig /etc/rsyslog.d/

+

In this case, all regular files in the /etc/rsyslog.d directory are included. +Files starting with "." are ignored - so you can use them to place comments into +the dir (e.g. "/etc/rsyslog.d/.mycomment" will be ignored). + +Michael Biebl had the idea to this functionality. Let me quote hím:

+
+

Say you can add an option
+$IncludeConfig /etc/rsyslog.d/
+(which probably would make a good default)
+to /etc/rsyslog.conf, which would then merge and include all *.conf files
+in /etc/rsyslog.d/.
+
+This way, a distribution can modify its packages easily to drop a simple
+config file into this directory upon installation.
+
+As an example, the network-manager package could install a simple config
+file /etc/rsyslog.d/network-manager.conf which would contain.
+:programname, contains, "NetworkManager" -/var/log/NetworkManager.log
+
+Upon uninstallation, the file could be easily removed again. This approach
+would be much cleaner and less error prone, than having to munge around
+with the /etc/rsyslog.conf file directly.

+
+

Please note that in this description, only "*.conf" files would be read. The +actual implementation, however, reads all files except for those starting with a +dot. If you find this is a real big problem, please complain.

RepeatedMsgReduction

This directive specifies whether or not repeated messages should be reduced (this is the "Last line repeated n times" feature). If set to on, repeated messages are reduced. If set to off, every -- cgit