summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaz <me@saz.sh>2011-12-04 23:34:20 +0100
committerSaz <me@saz.sh>2011-12-04 23:34:20 +0100
commit4d060fee8b77157270869fa1d82b44a96fa575aa (patch)
treeb79b849400a7a81b58ff3fb6289bef6d6544c4bd
parent796cd0b06aeed6e2dd35bd8ea302f3da8db8be22 (diff)
Use different ruleset for remote logging via TCP and UDP (RELP requires version 6.3.6+ of rsyslog)
-rw-r--r--templates/server.conf.erb37
1 files changed, 25 insertions, 12 deletions
diff --git a/templates/server.conf.erb b/templates/server.conf.erb
index 9b63a00..b317ec1 100644
--- a/templates/server.conf.erb
+++ b/templates/server.conf.erb
@@ -1,25 +1,25 @@
# File is managed by puppet
-<% if scope.lookupvar('rsyslog::server::high_precision_timestamps') == false -%>
-#
-# Use traditional timestamp format.
-# To enable high precision timestamps, comment out the following line.
-#
-$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
-<% end -%>
-
<% if scope.lookupvar('rsyslog::server::enable_udp') -%>
+# Load UDP module
$ModLoad imudp
-$UDPServerRun 514
<% end -%>
<% if scope.lookupvar('rsyslog::server::enable_tcp') -%>
+# Load TCP module
$ModLoad imtcp
-$InputTCPServerRun 514
<% end -%>
-$ModLoad imrelp
-$InputRELPServerRun 2514
+<% if scope.lookupvar('rsyslog::server::high_precision_timestamps') == false -%>
+#
+# Use traditional timestamp format.
+# To enable high precision timestamps, comment out the following line.
+#
+$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
+<% end -%>
+
+# Switch to remote ruleset
+$RuleSet remote
# Templates
$Template dynAuthLog,"<%= scope.lookupvar('rsyslog::server::server_dir') -%>%source:R,ERE,1,DFLT:([A-Za-z-]*)--end%/auth.log"
@@ -44,3 +44,16 @@ user.* -?dynUserLog
auth.none,authpriv.none;\
cron.none,daemon.none;\
mail.none,news.none -?dynMessages
+
+# Switch back to default ruleset
+$RuleSet RSYSLOG_DefaultRuleset
+
+<% if scope.lookupvar('rsyslog::server::enable_udp') -%>
+$InputUDPServerBindRuleset remote
+$UDPServerRun 514
+<% end -%>
+
+<% if scope.lookupvar('rsyslog::server::enable_tcp') -%>
+$InputTCPServerBindRuleset remote
+$InputTCPServerRun 514
+<% end -%>