-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
New syslog
sink
#6863
Comments
Will probably have to support both old (rfc3164) and new (rfc5424). |
Hello, |
Thank you for this feedback, |
Just leaving a comment here that I started working on a new syslog sink, with #7106 as inspiration. |
Great! Just a note that we would like to approach this sink a bit differently than #7106 did due to the enhanced codec support that was added to sinks after that PR was opened. Essentially, we'd like to create a Let me know if that makes sense. Happy to help guide a PR here! |
Got it, thanks, @jszwedko. Will post a WIP PR as soon as. |
Is this being worked on? |
Yes, it is. Slowly but surely ;) |
I would like to hear more about this, need to figure out how to use vector for syslog sink, any additional info would be helpful!! |
Who is working on this issue, which I can join? |
Any updates to where we're with this, please? To support syslog as sink either the code for Syslog via Socket or Syslog as sink itself? |
No updates yet on our end but we agree this would be a good idea if anyone is motivated to contribute! I still think the best approach would be to implement as a "codec" in Vector. The GELF codec could be a reasonable example to base it on. |
I have a syslog codec implementation, but it is specialized for OpenShift's needs. Let me extract it into a PR against the mainline, it might serve as a starting point for what we want to build. |
@syedriko - any luck with the syslog codec? |
@amarnathpv Here you go: #17668 |
Many thanks @syedriko. That would greatly help! How can I get this version for testing? |
You can build vector from my repo https://github.com/syedriko/vector.git, off the branch syedriko-syslog-codec. For a start, you can bounce this config
against rsyslogd:
Since syslog is a codec just like the other codecs, you can run your socket sink on top of UDP, TCP and TLS. Syslog message fields can be hardcoded in the sink configuration as above, but they can also be populated from the log event fields. Here's an example:
, which produces
The "$$.message.host" syntax is there for legacy reasons. "host" is the name of the log event field to populate the RFC 5424 msg_id field with. |
Awesome, thanks Sergej @sydreko |
@pznamensky I'm glad to hear ^^^, it's working pretty well in OpenShift, too. I'll get to it, too many balls to juggle. |
@syedriko @jszwedko Any update on this? I was going to use Vector to emit syslog from multiple sources and ran into a road-block because of the lack of a Basically I sent syslof from multiple sources into vector and parse these as JSON, but I also need to forward the original Syslog to other follow-on processes. |
Nothing yet unfortunately. If anyone wants to take a stab at contributing this, I think the path would look like:
|
What about #17668 ? It seems to cover those. |
That looks like a good start! The original author seems to have fallen off unfortunately, but it should serve as a good base for a new PR. |
@jszwedko I haven't gone anywhere, just been swamped. It would be great to get #17668 reviewed so I can start addressing the feedback. |
@syedriko Awesome to hear, can you update you branch and fix merge conflicts. Also mark it as ready, right now it shows as "Draft" |
Done |
Thanks @syedriko ! We'll take a look and leave a review. |
Awesome functionality, because a lot of tools accept syslog only... BTW, pretty nice practice - support same inputs and sinks. One of benefit of vector - be like wrapper, manipulate with data on-the-fly... |
Also interested in this. Can this be ressurected to have syslog sink functionality? |
@polarathene is working on it: #17668 (comment) |
Hey @gaby I will have time this weekend to wrap up the refactor PR and publish it as WIP. I'd like to refactor it some more and add some tests before bothering the team to review it, but it's in fairly good shape if you'd like to help test it out when published to ensure it's headed in the right direction :) I'll send a link here once it's up 👍 EDIT: Sorry for the delay, life and burn-out happened 😬 |
As a workaround, you can try assembling syslog messages yourselves. ...
transforms:
...
syslog_logs:
type: remap
inputs: ["some_logs"]
# let's make RFC 5424 compatible messages for rsyslog
# read more about the format:
# https://blog.datalust.co/seq-input-syslog/#rfc5424
source: |-
., err = "<86>1 " + to_string(.timestamp) + " eks " + .kubernetes.container_name + " 0 - - " + decode_base16!("EFBBBF") + .message
if err != null {
log(err, level: "error")
}
...
sinks:
rsyslog_general:
type: "socket"
inputs: ["syslog_logs"]
address: "some_ip:12345"
mode: "tcp"
encoding:
codec: "text"
framing:
method: "newline_delimited"
To receive messages, we use imptcp module in rsyslog. |
@pznamensky Thanks for sharing! |
@pznamensky thank you!
And here is unit test (I fell in love with Vector's unit tests 🙂):
I think |
I wonder if this is something VRL/Vector could add a function for? |
👍 I think it would make sense to have a VRL function too. |
As per #6862, we should have a
syslog
sink that makes it easy to send Syslog formatted logs. This should wrap thesocket
sink to support the various socket protocols.The text was updated successfully, but these errors were encountered: