Shell record UDP stream from a specific address

netcattcpdumpudp

I'm trying to record an incoming UDP stream (stream the sense that it's a stream of consecutive datagrams).

I tried netcat but unfortunately multiple sources send data on the same port address and nc doesn't let you specify the source or the target multicast address.

Then I tried tcpdump -w - because tcpdump has rich filtering options, but it records the raw stream and I only need the actual data so I can process it like it were a stream. Unfortunately it records all the packet related info like source/destination or IP/UDP headers.

Is there a way to do this? I could write a small C program to do this but I prefer to use existing tools.

Best Answer

My first choose would be wireshark. If you must do it from a terminal you can also try ngrep, it gives a more readable output than tcpdump. You can probably filter out the header info with a simple bash script.

http://ngrep.sourceforge.net/usage.html#http

Related Topic