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

How to I add a wireshark filter to record only HTTP requests and not responses?

0

How to I add a filter to record only HTTP requests and not responses?

asked 10 Jul '12, 05:01

sorin's gravatar image

sorin
6335
accept rate: 0%


One Answer:

0

filter to RECORD only HTTP requests

well, that's not easy. One option would be to use tshark

tshark -i eth0 (or 1,2,3,4... on windows) -R "http.request"

However that will only print the result to STDOUT. You cannot write a pcap file with -w, at least not with the current releases of tshark/wireshark.

However, with a little "trick", you can import the tshark output.

tshark -i eth0 (or 1,2,3,4... on windows) -R "http.request" -x > http_request.txt

In Wireshark

File -> Import

Select http_request.txt and you will get only the requests in Wireshark.

HOWEVER: I would rather capture everything and then (later) use a display filter (http.request) in Wireshark to only display the http requests. Maybe you want to know the answer for some requests ;-)

Regards
Kurt

answered 11 Jul '12, 07:16

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
24.8k1039237
accept rate: 15%

edited 11 Jul '12, 07:39