When running tcpdump on the command line, packets appear in realtime as they are received. However, when tcpdump is piped into anything, it resorts to buffered output. The -l and -U options are provided to allow configuration of this. However, I find that no matter what options I set, the result is never as fast as running from the raw CLI. I've tried Python with subprocess, tee, and even a Rust wrapper. Packets always appear to be output in batches.
Any ideas?
unbufferfrom theexpectpackage seems to fix it. Not completely sure what that indicates – anderspitman Apr 12 '18 at 22:11