Skip to content

Commit 08ce94d

Browse files
authored
Merge pull request #931 from mssonicbld/sonicbld/202405-merge
```<br>* 1c528e7 - (HEAD -> 202405) Merge branch '202405' of https://github.com/sonic-net/sonic-buildimage into 202405 (2025-03-20) [Sonic Automation] * 8ad6f85 - (head/202405) [rsyslog]: Remote logging with the highest rule priority (#22021) (2025-03-19) [mssonicbld]<br>```
2 parents dfb1a79 + 1c528e7 commit 08ce94d

File tree

4 files changed

+52
-52
lines changed

4 files changed

+52
-52
lines changed

files/image_config/rsyslog/rsyslog.conf.j2

+28-28
Original file line numberDiff line numberDiff line change
@@ -64,34 +64,6 @@ template(name="WelfRemoteFormat" type="string" string="%TIMESTAMP% id=firewall t
6464
:::date-year%-%timereported:::date-month%-%timereported:::date-day% %timereported:::date-hour%:%timereported:::date-minute%:%timereported\
6565
:::date-second%\" fw=\"{{ fw_name }}\" pri=%syslogpriority% msg=\"%syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\"\n")
6666

67-
#
68-
# Set the default permissions for all log files.
69-
#
70-
$FileOwner root
71-
$FileGroup adm
72-
$FileCreateMode 0640
73-
$DirCreateMode 0755
74-
$Umask 0022
75-
76-
#
77-
# Where to place spool and state files
78-
#
79-
$WorkDirectory /var/spool/rsyslog
80-
81-
#
82-
# Include all config files in /etc/rsyslog.d/
83-
#
84-
$IncludeConfig /etc/rsyslog.d/*.conf
85-
86-
#
87-
# Suppress duplicate messages and report "message repeated n times"
88-
#
89-
$RepeatedMsgReduction on
90-
91-
###############
92-
#### RULES ####
93-
###############
94-
9567
#
9668
# Remote syslog logging
9769
#
@@ -134,3 +106,31 @@ $RepeatedMsgReduction on
134106
*.{{ severity }}
135107
action(type="omfwd" Target="{{ server }}" Port="{{ port }}" Protocol="{{ proto }}" Template="{{ template }}"{{ options }})
136108
{% endfor %}
109+
110+
#
111+
# Set the default permissions for all log files.
112+
#
113+
$FileOwner root
114+
$FileGroup adm
115+
$FileCreateMode 0640
116+
$DirCreateMode 0755
117+
$Umask 0022
118+
119+
#
120+
# Where to place spool and state files
121+
#
122+
$WorkDirectory /var/spool/rsyslog
123+
124+
#
125+
# Include all config files in /etc/rsyslog.d/
126+
#
127+
$IncludeConfig /etc/rsyslog.d/*.conf
128+
129+
#
130+
# Suppress duplicate messages and report "message repeated n times"
131+
#
132+
$RepeatedMsgReduction on
133+
134+
###############
135+
#### RULES ####
136+
###############

src/sonic-config-engine/setup.cfg

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[aliases]
2+
test=pytest

src/sonic-config-engine/tests/sample_output/py3/rsyslog.conf

+11-12
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,17 @@ template(name="WelfRemoteFormat" type="string" string="%TIMESTAMP% id=firewall t
4949
:::date-year%-%timereported:::date-month%-%timereported:::date-day% %timereported:::date-hour%:%timereported:::date-minute%:%timereported\
5050
:::date-second%\" fw=\"kvm-host\" pri=%syslogpriority% msg=\"%syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\"\n")
5151

52+
#
53+
# Remote syslog logging
54+
#
55+
56+
# The omfwd plug-in provides the core functionality of traditional message
57+
# forwarding via UDP and plain TCP. It is a built-in module that does not need
58+
# to be loaded.
59+
60+
*.*
61+
action(type="omfwd" Target="3.3.3.3" Port="514" Protocol="udp" Template="SONiCForwardFormat")
62+
5263
#
5364
# Set the default permissions for all log files.
5465
#
@@ -76,15 +87,3 @@ $RepeatedMsgReduction on
7687
###############
7788
#### RULES ####
7889
###############
79-
80-
#
81-
# Remote syslog logging
82-
#
83-
84-
# The omfwd plug-in provides the core functionality of traditional message
85-
# forwarding via UDP and plain TCP. It is a built-in module that does not need
86-
# to be loaded.
87-
88-
*.*
89-
action(type="omfwd" Target="3.3.3.3" Port="514" Protocol="udp" Template="SONiCForwardFormat")
90-

src/sonic-config-engine/tests/sample_output/py3/rsyslog_with_docker0.conf

+11-12
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ template(name="WelfRemoteFormat" type="string" string="%TIMESTAMP% id=firewall t
5151
:::date-year%-%timereported:::date-month%-%timereported:::date-day% %timereported:::date-hour%:%timereported:::date-minute%:%timereported\
5252
:::date-second%\" fw=\"kvm-host\" pri=%syslogpriority% msg=\"%syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\"\n")
5353

54+
#
55+
# Remote syslog logging
56+
#
57+
58+
# The omfwd plug-in provides the core functionality of traditional message
59+
# forwarding via UDP and plain TCP. It is a built-in module that does not need
60+
# to be loaded.
61+
62+
*.*
63+
action(type="omfwd" Target="3.3.3.3" Port="514" Protocol="udp" Template="SONiCForwardFormat")
64+
5465
#
5566
# Set the default permissions for all log files.
5667
#
@@ -78,15 +89,3 @@ $RepeatedMsgReduction on
7889
###############
7990
#### RULES ####
8091
###############
81-
82-
#
83-
# Remote syslog logging
84-
#
85-
86-
# The omfwd plug-in provides the core functionality of traditional message
87-
# forwarding via UDP and plain TCP. It is a built-in module that does not need
88-
# to be loaded.
89-
90-
*.*
91-
action(type="omfwd" Target="3.3.3.3" Port="514" Protocol="udp" Template="SONiCForwardFormat")
92-

0 commit comments

Comments
 (0)