diff options
author | Viacheslav <v.gletenko@vyos.io> | 2021-12-21 19:41:23 +0000 |
---|---|---|
committer | Viacheslav <v.gletenko@vyos.io> | 2021-12-27 09:42:52 +0000 |
commit | cd8015a4b60e486f465aef9abfd0861988e4f32d (patch) | |
tree | 749d2670b573199dfaa780781f9a134f00c72b64 | |
parent | 9275fd942cef387c1163bcdf5fff3a200f557f4c (diff) | |
download | vyos-1x-cd8015a4b60e486f465aef9abfd0861988e4f32d.tar.gz vyos-1x-cd8015a4b60e486f465aef9abfd0861988e4f32d.zip |
syslog: T4039: Add protocol23format logging for UDP
Add protocol23format for rsyslog protocol UDP
Add ability to use IPv6 addresses (bracketize_ipv6) for
protocol TCP and UDP, when protocol is configured explicity
-rw-r--r-- | data/templates/syslog/rsyslog.conf.tmpl | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/data/templates/syslog/rsyslog.conf.tmpl b/data/templates/syslog/rsyslog.conf.tmpl index e25ef48d4..2fb621760 100644 --- a/data/templates/syslog/rsyslog.conf.tmpl +++ b/data/templates/syslog/rsyslog.conf.tmpl @@ -25,12 +25,18 @@ $outchannel {{ file }},{{ file_options['log-file'] }},{{ file_options['max-size' {% if host_options.proto == 'tcp' %} {% if host_options.port is defined %} {% if host_options.oct_count is defined %} -{{ host_options.selectors }} @@(o){{ host }}:{{ host_options.port }};RSYSLOG_SyslogProtocol23Format +{{ host_options.selectors }} @@(o){{ host | bracketize_ipv6 }}:{{ host_options.port }};RSYSLOG_SyslogProtocol23Format {% else %} -{{ host_options.selectors }} @@{{ host }}:{{ host_options.port }} +{{ host_options.selectors }} @@{{ host | bracketize_ipv6 }}:{{ host_options.port }} {% endif %} {% else %} -{{ host_options.selectors }} @@{{ host }} +{{ host_options.selectors }} @@{{ host | bracketize_ipv6 }} +{% endif %} +{% elif host_options.proto == 'udp' %} +{% if host_options.port is defined %} +{{ host_options.selectors }} @{{ host | bracketize_ipv6 }}:{{ host_options.port }}{{ ';RSYSLOG_SyslogProtocol23Format' if host_options.oct_count is sameas true }} +{% else %} +{{ host_options.selectors }} @{{ host | bracketize_ipv6 }} {% endif %} {% else %} {% if host_options['port'] %} |