socktee

Crates.iosocktee
lib.rssocktee
version0.1.0
sourcesrc
created_at2022-04-22 14:43:24.991537
updated_at2022-04-22 14:43:24.991537
descriptionA command line utility to copy UNIX domain socket datagrams from one socket to two other sockets
homepagehttps://sr.ht/~jpastuszek/socktee/
repositoryhttps://git.sr.ht/~jpastuszek/socktee
max_upload_size
id572202
size32,299
Jakub Pastuszek (jpastuszek)

documentation

README

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
Commit count: 0

cargo fmt