I have a syslog server which writes to a unix stream /tmp/syslog.socket
.
I need to duplicate this stream to multiple TCP clients. Is there a way to achieve this using socat?
I think I just accomplished this, especially the duplicating part, with the help of Some Helpful socat Commands.
socat TCP-LISTEN:4444,reuseaddr,fork SYSTEM:"tail -f ~/.tail-error-logs/*",pty
fork
is important on the left side, pty
is important on the right side.
What didn't work, was netcat style:
tail -f ~/.tail-error-logs/* | socat STDIO TCP-LISTEN:4444,fork,reuseaddr
It had the effect of output alternating between multiple attached clients, which is also documented on above website.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With