Capture Only HTTP traffic in tshark

11,549

Use a display filter:

tshark -Y http

If you need to save the capture, you can run the display filter on the output:

tshark -r packetFile.pcap -Y http -w packetFile-http.pcap
Share:
11,549

Related videos on Youtube

Seeker
Author by

Seeker

Updated on September 18, 2022

Comments

  • Seeker
    Seeker over 1 year

    I am new to tshark tool usage. I am trying to use tshark tool for capturing only HTTP traffic but i am unable to do it. Here is the cmd i run to get the all traffic:

    tshark -c 1000 -w packetFile.pcap 
    

    Anyway i can filter out only http traffic?

  • brablc
    brablc almost 6 years
    Display filter is nice, but for capturing only http, this can be used: tshark -f 'port http'