This is our old Q&A Site. Please post any new questions and answers at

I am trying to run tshark for an extended period of time to reassemble NFS requests that I capture using tcpdump (with pf_ring). I am streaming the pcap to standard out from tcpdump (using -w -) and into tshark (using -i -). It seems that tshark calls dumpcap to do the packet capture (even from stdin) and then dumpcap writes the packets to the /tmp directory and then tshark reads from there. The reading and writing to disk was a bottleneck for me so I specified a new location using the TMPDIR environment variable and set it to a tmpfs mount. This was successful in speeding up the tshark processing but once the tmpfs mount fills up, tshark crashes. First, I would like to confirm that this is the correct behavior. If so, I have two questions:

  1. Can we remove dumpcap from the equation if we are just reading from stdin (so that it is similar to reading from a file)?
  2. Is there a way to tell tshark to roll the temp files (similarly to how it will roll the raw packet captures if using the -w argument) so that it just overwrites old files rather than filling up the directory until it gets an Out of Memory exception?

Thank you.

asked 11 Dec '12, 13:17

notorious-pcaper's gravatar image

accept rate: 0%

There is currently an old bug which says that tshark should not be using files when in this configuration (bug 2743).

To answer your questions:

  1. Not if tshark is reading from a pipe. If tshark supported live-capture from a file (as requested in bug 5982) then that would be a way to avoid the pipe.
  2. Yes, I would think (but I have not tried) that using the standard ring-buffer options would achieve this.
permanent link

answered 12 Dec '12, 07:52

JeffMorriss's gravatar image

JeffMorriss ♦
accept rate: 27%

Using the -b option when not writing out raw packets with the -w option does not work. The -b will only affect the explicit output. If there is no -w option, then tshark will just exit immediately.

(12 Dec '12, 09:25) notorious-pc...

Ah, right, makes sense. Oh well...

(12 Dec '12, 12:31) JeffMorriss ♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 11 Dec '12, 13:17

question was seen: 3,410 times

last updated: 12 Dec '12, 12:31

p​o​w​e​r​e​d by O​S​Q​A