This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Rolling Capture for a week’s long event

1

Is there a way to truncate the capture log to say 4 or 6 hours? I need to diagnose a problem that happens randomly every 4-14 days, and would like to have a capture of the data happening at the moment of the event without crushing the computer running Wireshark for 14 days straight...

asked 24 Aug '11, 06:47

cshep70's gravatar image

cshep70
16112
accept rate: 0%


One Answer:

4

You can use dumpcap (included with Wireshark) for that purpose. I have kept dumpcap running for months in that manner. The clue is to make use of the ringbuffer functionality. You will want to use something like:

dumpcap -i <interface> -w <file.cap> -b filesize:32768 -b files:128

This will create a 4GB ringbuffer (128 files of 32MB). This way you will never run out of disk space and keep only the last 4GB of capture data until the problem occurs and the dumpcap command is stopped (by ctrl+C).

answered 24 Aug '11, 06:58

SYN-bit's gravatar image

SYN-bit ♦♦
17.1k957245
accept rate: 20%

Much Obliged! That's what I had been looking for.

(24 Aug '11, 07:45) cshep70