## generated by syslog.py ##
## file based logging
{% if files['global']['marker'] %}
$ModLoad immark
{% if files['global']['marker-interval'] %}
$MarkMessagePeriod  {{files['global']['marker-interval']}}
{% endif %}
{% endif %}
{% if files['global']['preserver_fqdn'] %}
$PreserveFQDN on
{% endif %}
{% for file in files %}
$outchannel {{file}},{{files[file]['log-file']}},{{files[file]['max-size']}},{{files[file]['action-on-max-size']}}
{{files[file]['selectors']}} :omfile:${{file}}
{% endfor %}
{% if console %}
## console logging
{% for con in console %}
{{console[con]['selectors']}} /dev/console
{% endfor %}
{% endif %}
{% if hosts %}
## remote logging
{% for host in hosts %}
{%   if hosts[host]['proto'] == 'tcp' %}
{%     if hosts[host]['port'] %}
{%       if hosts[host]['oct_count'] %}
{{hosts[host]['selectors']}} @@(o){{host}}:{{hosts[host]['port']}};RSYSLOG_SyslogProtocol23Format
{%       else %}
{{hosts[host]['selectors']}} @@{{host}}:{{hosts[host]['port']}}
{%       endif %}
{%     else %}
{{hosts[host]['selectors']}} @@{{host}}
{%     endif %}
{%   else %}
{%     if hosts[host]['port'] %}
{{hosts[host]['selectors']}} @{{host}}:{{hosts[host]['port']}}
{%     else %}
{{hosts[host]['selectors']}} @{{host}}
{%     endif %}
{%   endif %}
{% endfor %}
{% endif %}
{% if user %}
{% for u in user %}
{{user[u]['selectors']}} :omusrmsg:{{u}}
{% endfor %}
{% endif %}