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

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%

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.

permanent link

answered 24 Sep '10, 06:09

Jasper's gravatar image

Jasper ♦♦
accept rate: 18%

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: 24 Sep '10, 05:59

question was seen: 16,533 times

last updated: 24 Sep '10, 06:09

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