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

I'm currently using this to get a list of protocols found in a pcap file.

tshark -r ~/Downloads/smallFlows.pcap -Tfields -eframe.protocols | sort | uniq

I would like to narrow this down to application layer protocols only. Can I do this without filtering the output with a script (ie: Tshark and terminal commands only?)

EDIT

I managed to get it doing this:

tshark -r ~/Downloads/smallFlows.pcap -Tfields -eframe.protocols -R "tcp && ip.addr==192.168.3.131" -2 | sort | uniq | cut -d ':' -f 5

I'm curious to know if there's a better way of doing this though!

asked 15 Jun '15, 02:32

Alexandre%20Kaskasoli's gravatar image

Alexandre Ka...
1223
accept rate: 0%

edited 15 Jun '15, 02:47


How about this one?

tshark -nr input.pcap -T fields -e frame.protocols | tr ":" "\n" | egrep -v "(eth|ip|tcp|udp)" | sort -u

Regards
Kurt

permanent link

answered 15 Jun '15, 09:51

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
24.8k1039237
accept rate: 15%

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:

×832
×26
×12

question asked: 15 Jun '15, 02:32

question was seen: 2,711 times

last updated: 15 Jun '15, 09:51

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