summaryrefslogtreecommitdiff
path: root/data/templates/syslog/rsyslog.conf.tmpl
blob: 10fbb9d3c9367e463ce048b38b21770d7280a56c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
## 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 %}