crowbar/crowbar-core

View on GitHub
chef/cookbooks/logging/templates/default/rsyslog.server.erb

Summary

Maintainability
Test Coverage

# remote rsyslog from Ubuntu will log here using TCP
$ModLoad imtcp
$InputTCPServerRun 514

# remote syslog from CentOS will log here using UDP
$ModLoad imudp
$UDPServerRun 514

# split remote logs by hostname
# stop processing the line after it has been logged
$template DynaFile,"/var/log/nodes/%HOSTNAME%.log"
if $fromhost-ip != '127.0.0.1' then -?DynaFile
<% if @rsyslog_version < "7" %>
& ~
<% else %>
& stop
<% end %>

<% @external_servers.each do |external_server| -%>
*.* @@<%= external_server %>
<% end -%>