# file is managed by puppet
#
<% if scope.lookupvar('rsyslog::client::log_remote') -%>
# Log to remote syslog server using <%= scope.lookupvar('rsyslog::client::remote_type') %>
# Templates
# Would match 'kernel:'  -> 'kernel'    ;  'rsyslog[12345]:'  -> 'rsyslog' ; '<180>(nova.api.wsgi):'  ->  'nova.api.wsgi'
$Template CustomLog, "%$NOW%T%TIMESTAMP:8:$%Z %syslogseverity-text% %syslogtag% %msg:drop-last-lf%\n"

<% scope.lookupvar('rsyslog::client::rservers_real').each do |rserver| -%>
<% if ! (['localhost','127.0.0.1','::1'].include?(rserver['server']) and (scope.lookupvar('rsyslog::client::log_auth_local') or scope.lookupvar('rsyslog::client::log_local'))) -%>
<% if rserver['remote_type'] == 'tcp' -%>
# Send messages we receive to master node via tcp
*.* @@<%= rserver['server']-%>:<%= rserver['port'] -%>;CustomLog
<% else -%>
# Send messages we receive to master node via udp
*.* @<%= rserver['server'] -%>:<%= rserver['port'] -%>;CustomLog
<% end -%>
<% end -%>
<% end -%>
<% end -%>

# file is managed by puppet
#
<% if scope.lookupvar('rsyslog::client::log_remote') -%>
# Log to remote syslog server using <%= scope.lookupvar('rsyslog::client::remote_type') %>
# Templates
# Would match 'kernel:'  -> 'kernel'    ;  'rsyslog[12345]:'  -> 'rsyslog' ; '<180>(nova.api.wsgi):'  ->  'nova.api.wsgi'
$Template CustomLog, "%$NOW%T%TIMESTAMP:8:$%Z %syslogseverity-text% %syslogtag% %msg:drop-last-lf%\n"

<% scope.lookupvar('rsyslog::client::rservers_real').each do |rserver| -%>
<% if ! ['localhost','127.0.0.1','::1'].include?(rserver['server']) -%>
<% if rserver['remote_type'] == 'tcp' -%>
# Send messages we receive to master node via tcp
*.* @@<%= rserver['server']-%>:<%= rserver['port'] -%>;CustomLog
<% else -%>
# Send messages we receive to master node via udp
*.* @<%= rserver['server'] -%>:<%= rserver['port'] -%>;CustomLog
<% end -%>
<% end -%>
<% end -%>
<% end -%>

Allow remote and local rsyslogging simultanousely
Allow remote and local rsyslogging simultanousely

Signed-off-by: Bogdan Dobrelya <62b3a3e71fe69d786a0eb2bf561b6ce08e31d2cc@mail.ru>
