-
Notifications
You must be signed in to change notification settings - Fork 662
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[syslog] Adjust runningconfiguration syslog command (#2843)
#### What I did Adjust `show runningconfiguration syslog` command according to the new syslog configuration file #### How I did it Fix regex to match the target syslog server #### How to verify it Run the next command in sonic shell: ``` show runningconfiguration syslog ```
- Loading branch information
Showing
3 changed files
with
103 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
############################################################################### | ||
# Managed by Ansible | ||
# file: ansible/roles/acs/templates/rsyslog.conf.j2 | ||
############################################################################### | ||
# | ||
# /etc/rsyslog.conf Configuration file for rsyslog. | ||
# | ||
# For more information see | ||
# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html | ||
|
||
|
||
################# | ||
#### MODULES #### | ||
################# | ||
|
||
$ModLoad imuxsock # provides support for local system logging | ||
$ModLoad imklog # provides kernel logging support | ||
#$ModLoad immark # provides --MARK-- message capability | ||
|
||
# provides UDP syslog reception | ||
$ModLoad imudp | ||
$UDPServerAddress 127.0.0.1 #bind to localhost before udp server run | ||
$UDPServerRun 514 | ||
|
||
# provides TCP syslog reception | ||
#$ModLoad imtcp | ||
#$InputTCPServerRun 514 | ||
|
||
|
||
########################### | ||
#### GLOBAL DIRECTIVES #### | ||
########################### | ||
# | ||
# Use traditional timestamp format. | ||
# To enable high precision timestamps, comment out the following line. | ||
# | ||
#$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat | ||
|
||
# Define a custom template | ||
$template SONiCFileFormat,"%timegenerated%.%timegenerated:::date-subseconds% %HOSTNAME% %syslogseverity-text:::uppercase% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n" | ||
$ActionFileDefaultTemplate SONiCFileFormat | ||
|
||
template(name="WelfRemoteFormat" type="string" string="%TIMESTAMP% id=firewall time=\"%timereported\ | ||
:::date-year%-%timereported:::date-month%-%timereported:::date-day% %timereported:::date-hour%:%timereported:::date-minute%:%timereported\ | ||
:::date-second%\" fw=\"sonic\" pri=%syslogpriority% msg=\"%syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\"\n") | ||
|
||
#Set remote syslog server | ||
*.notice | ||
action(type="omfwd" Target="1.1.1.1" Port="514" Protocol="udp" Device="eth0" Template="SONiCFileFormat") | ||
|
||
# | ||
# Set the default permissions for all log files. | ||
# | ||
$FileOwner root | ||
$FileGroup adm | ||
$FileCreateMode 0640 | ||
$DirCreateMode 0755 | ||
$Umask 0022 | ||
|
||
# | ||
# Where to place spool and state files | ||
# | ||
$WorkDirectory /var/spool/rsyslog | ||
|
||
# | ||
# Include all config files in /etc/rsyslog.d/ | ||
# | ||
$IncludeConfig /etc/rsyslog.d/*.conf | ||
|
||
# | ||
# Suppress duplicate messages and report "message repeated n times" | ||
# | ||
$RepeatedMsgReduction on | ||
|
||
############### | ||
#### RULES #### | ||
############### |