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

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%


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

permanent link

answered 11 Jul '12, 07:16

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
24.8k1039237
accept rate: 15%

edited 11 Jul '12, 07:39

Your answer
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×4

question asked: 10 Jul '12, 05:01

question was seen: 1,568 times

last updated: 11 Jul '12, 07:39

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