-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
fix: syslog plugin doesn't work #9425
Conversation
@Sn0rt please help to review |
@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 Updated, please review again, thanks. |
LGTM @monkeyDluffy6017 pls approve CI. |
@shreemaan-abhishek your commit has been duplicated here |
@jiangfucheng Could you merge the master branch, some ci error are fixed |
Co-authored-by: leslie <leslie@apache.org>
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