From 4666bbc2164d9e0104916a5ea5bf2528bf4e1043 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Sat, 8 Mar 2025 21:04:32 +0100 Subject: syslog: T7229: advanced format should not have IPv6 addresses in [] brackets Otherwise rsyslog will report an error: omfwd: could not get addrinfo for hostname '[2001:db8::2]':'514': System error --- data/templates/rsyslog/rsyslog.conf.j2 | 2 +- smoketest/scripts/cli/test_system_syslog.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/data/templates/rsyslog/rsyslog.conf.j2 b/data/templates/rsyslog/rsyslog.conf.j2 index e2ff334ff..68e34f3f8 100644 --- a/data/templates/rsyslog/rsyslog.conf.j2 +++ b/data/templates/rsyslog/rsyslog.conf.j2 @@ -98,7 +98,7 @@ if prifilt("{{ tmp | join(',') }}") then { action( type="omfwd" # Remote syslog server where we send our logs to - target="{{ remote_name | bracketize_ipv6 }}" + target="{{ remote_name }}" # Port on the remote syslog server port="{{ remote_options.port }}" protocol="{{ remote_options.protocol }}" diff --git a/smoketest/scripts/cli/test_system_syslog.py b/smoketest/scripts/cli/test_system_syslog.py index e642b5660..b3eb616ee 100755 --- a/smoketest/scripts/cli/test_system_syslog.py +++ b/smoketest/scripts/cli/test_system_syslog.py @@ -132,10 +132,16 @@ class TestRSYSLOGService(VyOSUnitTestSHIM.TestCase): 'facility': {'auth' : {'level': 'info'}}, 'protocol': 'udp', }, - '169.254.0.2': { + '2001:db8::1': { + 'facility': {'all' : {'level': 'debug'}}, 'port': '1514', 'protocol': 'udp', }, + 'syslog.vyos.net': { + 'facility': {'all' : {'level': 'debug'}}, + 'port': '1515', + 'protocol': 'tcp', + }, '169.254.0.3': { 'facility': {'auth' : {'level': 'info'}, 'kern' : {'level': 'debug'}, -- cgit v1.2.3