-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[dhcp_server] Add rsyslog support for dhcp_server #19303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
b51af63
[dhcp_server] Add rsyslog support for dhcp_server
yaqiangz 9439619
Add ut
yaqiangz 8cb0540
Set include_dhcp_server to y
yaqiangz c76691e
Remove generate config
yaqiangz ef5e7a0
Merge branch 'master' into master_dhcp_server_syslog
yaqiangz 25ac090
Revert "Set include_dhcp_server to y"
yaqiangz 5b2475b
Revert "Revert "Set include_dhcp_server to y""
yaqiangz 84461d2
Update template
yaqiangz 1e610c9
Update ut
yaqiangz ede7095
Merge branch 'master' into master_dhcp_server_syslog
yaqiangz 45e591d
Modify Dockerfile
yaqiangz c87229f
Set include_dhcp_server to n
yaqiangz 3ce6d2c
Merge branch 'master' into master_dhcp_server_syslog
yaqiangz f24a5a2
Merge branch 'master' into master_dhcp_server_syslog
yaqiangz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
94 changes: 94 additions & 0 deletions
94
src/sonic-config-engine/tests/sample_output/py3/rsyslog_with_docker0.conf
This file contains hidden or 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,94 @@ | ||
| ############################################################################### | ||
| # 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 10.150.22.222 #bind to localhost before udp server run | ||
| $UDPServerRun 514 | ||
|
|
||
| $ModLoad imudp | ||
| $UDPServerAddress 1.1.1.1 | ||
| $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:::date-year% %timegenerated%.%timegenerated:::date-subseconds% %HOSTNAME% %syslogseverity-text:::uppercase% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n" | ||
| $ActionFileDefaultTemplate SONiCFileFormat | ||
| $template SONiCForwardFormat,"<%PRI%>%TIMESTAMP:::date-rfc3339% %HOSTNAME% %syslogseverity-text:::uppercase% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n" | ||
| $ActionForwardDefaultTemplate SONiCForwardFormat | ||
|
|
||
| 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=\"kvm-host\" pri=%syslogpriority% msg=\"%syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\"\n") | ||
|
|
||
| # | ||
| # 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 #### | ||
| ############### | ||
|
|
||
| # | ||
| # Remote syslog logging | ||
| # | ||
|
|
||
| # The omfwd plug-in provides the core functionality of traditional message | ||
| # forwarding via UDP and plain TCP. It is a built-in module that does not need | ||
| # to be loaded. | ||
|
|
||
| *.* | ||
| action(type="omfwd" Target="10.150.22.222" Port="514" Protocol="udp" Template="SONiCForwardFormat") | ||
|
|
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.