Closed TanFFFF closed 3 years ago
I think the issue is that Vector listens for connections on the given socket path, but in order to read logs data from dnstap
it is necessary to connect to the socket created by the DNS server. It seems to be a more general issue, so I've created https://github.com/timberio/vector/issues/2042 about it.
I've been looking into getting dnstap working in Vector, and ran into this too.
What I've found is:
Currently, I have the LengthDelimitedCodec working, and if I hook it up to the unix socket coming from dnstap I get 2 events: one empty (signifying the next is a control frame), and one saying what the content type is (protobuf:dnstap.Dnstap).
I'm gonna hack around trying to get framestream to work. So far (for the LengthDelimitedCodec) I've just been adding to the socket source (unix mode), but this is quite a bit extra so I think it would make more sense as a separate framestream source.
Thought discussion of dnstap / framestream made more sense in a new issue #2516
Hello, I agree would be useful to have another option to make vector connect to an existing unix socket instead of open a new one. My use case is use vector to forward in real-time the logs produced by auditd and dispatched by audisp via af_unix plugin. Audisp at startup opens the socket and vector tries to do the same, resulting with error:
thread 'tokio-runtime-worker' panicked at 'failed to bind to listener socket: Os { code: 98, kind: AddrInUse, message: "Address already in use" }', src/sources/util/unix.rs:38:24
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Nov 26 15:32:09.106 ERROR source{name=audit type=socket}: vector::topology: An error occurred that vector couldn't handle.
In particular, the two following sources should be equivalent:
[sources.audit_sock]
type = "socket"
mode = "unix"
path = "/var/run/audispd_events"
[sources.audit_file]
type = "file"
include = ["/var/log/audit/audit.log"]
start_at_beginning = false
The objective is to avoid storing on the server the logs.
I believe this is issue is covered by:
I'll close it out in-lieu of those two.
@AlbertoArdu I believe #2042 covers your issue, but let me if not.
Recently I've tried Vector to read data from unix socket and send to Kafka.
First, I tested Vector by using socket source and console sink. But there is nothing ouput.
My
/etc/vector/vector.toml
is as below:However, if I change source to file source, and console sink, it works as expect.
Does anyone has problems with socket source? Please let me know if I wrong or something.