tcplinecombine

Crates.iotcplinecombine
lib.rstcplinecombine
version0.1.0
sourcesrc
created_at2023-03-05 20:09:48.754434
updated_at2023-03-05 20:09:48.754434
descriptionSimple CLI tool to collect incoming lines from TCP clients and compress them (without interleaving bytes within lines).
homepage
repositoryhttps://github.com/vi/tcplinecombine
max_upload_size
id801691
size19,170
Vitaly Shukela (vi)

documentation

README

tcplinecombine

Privitive logging server that accepts incoming line-based messages and stores them to one compressed file.

host1$ tcplinecombine 0.0.0.0:1234 output.zstd -i 5
host1: ...

host2$ date | nc 192.168.0.1 1234
^C
host2$ date | nc 192.168.0.1 1234
^C

host1:
Incoming connection from 127.0.0.1:44750
  finished serving 127.0.0.1:44750
Incoming connection from 127.0.0.1:44762
  finished serving 127.0.0.1:44762
^C (after waiting for 5 seconds)
host1$ zstdcat output.zstd
Sun Mar  5 21:05:05 CET 2023
Sun Mar  5 21:05:07 CET 2023
output.zstd : Read error (39) : premature end

Features

  • Handling multiple simultaneous connections and interleaving incoming lines (but not bytes).
  • zstd compression of output file with periodical flushes

Installation

Download a pre-built executable from Github releases or install from source code with cargo install --path . or cargo install tcplinecombine.

CLI options

tcplinecombine --help output
ARGS:
    <listenaddr>

    <outputfile>

OPTIONS:
    -i, --flush-interval <seconds>

    -l, --max-line-length <bytes>

    -h, --help
      Prints help information.

See also

Commit count: 3

cargo fmt