socktee 0.1.0

A command line utility to copy UNIX domain socket datagrams from one socket to two other sockets
socktee-0.1.0 is not a library.

Latest Version [Documentation] License

A command line utility to copy UNIX domain socket datagrams from one socket to two other sockets.

Features:

  • First destination socket is blocking.
  • Second destination socket is buffered.
  • Optionally drop oldest datagrams when buffer is full or block.
  • Reconnect to buffered socket without dropping (internally) buffered datagrams.
  • Configurable maximum datagram size and buffered socket buffer size.
  • Optionally prefix datagrams with TAI64N or RFC3339 receive timestamps.

Example usage

Forward copy of syslog messages to remote log server.

# Save syslog messages in a log file
socklog unix /var/run/syslog-local > /var/log/syslog &

# Forward syslog messages to remote log server
socklog unix -R /var/run/syslog-forward | nc -t prod.store.whatclinic.net 514 &

# Copy syslog messages for local storage and forwarding
umask 0000
socktee /dev/log /var/run/syslog-local /var/run/syslog-forward &

# Log a message
logger hello world