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

Data extraction from pcap files


I have machines on taps at critical visibility points in my network that run tshark as a service so that I have continuous packet capture (see tip#7 at Whether for troubleshooting or forensics, I frequently need to extract packets from the resulting pcap files for a specific IP address. Rather than having to use the (more manually intensive) GUI interface to do so, how can I use tshark (or editshark?) to extract data from one pcap file into another pcap file for that IP address?

asked 24 Sep '10, 05:59

johnb_hslda_org's gravatar image

accept rate: 0%

One Answer:


Usually I would just run tshark.exe -r <infile> -R "ip.addr==x.x.x.x" -w <outfile>, where x.x.x.x is the IP address you want to carve out. If I have more than one pcap file to process I run a batch on them, and sometimes merge them together in the end using mergecap -a.

answered 24 Sep '10, 06:09

Jasper's gravatar image

Jasper ♦♦
accept rate: 18%