fix: syslog plugin doesn't work#9425
Merged
Merged
Conversation
Contributor
|
@Sn0rt please help to review |
Contributor
|
@jiangfucheng thx your PR. can you add a test set to verify the syslog plugin is really working? I think https://github.com/apache/apisix/blob/master/t/plugin/tcp-logger.t#L466 is helpful for you. I think the below config file of file path [sources.log-from-syslog-tcp]
type = "syslog"
address = "0.0.0.0:5050"
mode = "tcp"
[sources.log-from-syslog-udp]
type = "syslog"
address = "0.0.0.0:5050"
host_key = "host"
mode = "udp"
port_key = "port"
shutdown_timeout_secs = 30
socket_file_mode = 511
[sinks.log-2-console]
inputs = [ "log-from-tcp", "log-from-tls", "log-from-syslog-tcp", "log-from-syslog-udp"]
type = "console"
encoding.codec = "json"
[sinks.log-2-syslog-tcp-file]
inputs = [ "log-from-syslog-tcp" ]
type = "file"
encoding.codec = "text"
path = "/etc/vector/syslog-tcp.log"
[sinks.log-2-syslog-udp-file]
inputs = [ "log-from-syslog-udp" ]
type = "file"
encoding.codec = "text"
path = "/etc/vector/syslog-udp.log"and some new test set at |
Sn0rt
reviewed
May 8, 2023
5 tasks
Member
Author
|
@Sn0rt Updated, please review again, thanks. |
Contributor
|
LGTM @monkeyDluffy6017 pls approve CI. |
Contributor
|
@shreemaan-abhishek your commit has been duplicated here |
Contributor
|
@jiangfucheng Could you merge the master branch, some ci error are fixed |
Co-authored-by: leslie <[email protected]>
Sn0rt
previously approved these changes
May 17, 2023
juststillthinking
approved these changes
May 17, 2023
Sn0rt
approved these changes
May 18, 2023
soulbird
approved these changes
May 18, 2023
leslie-tsang
approved these changes
May 18, 2023
AlinsRan
pushed a commit
to AlinsRan/apisix
that referenced
this pull request
Jun 25, 2023
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Fixes #9419
1.Convert the log message to RFC5424 format before sending it to the syslog server.
2.RFC5424 is “The Syslog Protocol", not only used for sls-logger. So, I relocated the file rfc5424.lua from apisix/plugins/slslog to apisix/syslog
Checklist