Skip to content
Tutorials Center
My learning

Topics

Lesson 9 of 37 ยท Filters and Display

Display Filter Basics

Learn Wireshark display filter basics: protocol names, fields like ip.addr and tcp.port, comparisons, the filter bar colors, Apply as Filter and filter buttons.

A real capture contains thousands or millions of packets. Display filters hide everything except what you care about, without deleting anything: clear the filter and all packets return. Display filters are the single most important Wireshark skill, and the good news is that they are easy to learn because Wireshark helps you write them.

Your first filters

Type a filter in the bar above the packet list and press Enter. The simplest filter is a protocol name, which shows every packet containing that protocol:

TEXT
dns
http
tcp
arp
icmp
tls

Next, filter on fields. Every item in the Packet Details tree has a field name made of the protocol and the field, separated by dots:

Filter Shows
ip.addr == 192.0.2.10 Packets from or to that IPv4 address
ip.src == 192.0.2.10 Only packets sent by it
ip.dst == 198.51.100.5 Only packets sent to it
tcp.port == 443 TCP source or destination port 443
udp.port == 53 UDP port 53
tcp.dstport == 80 Destination port 80 only
http.request.method == "GET" HTTP GET requests
dns.qry.name == "example.org" DNS queries for that name
eth.addr == 00:00:5e:00:53:01 A MAC address
frame.len > 1000 Frames longer than 1000 bytes

String values go in double quotes; numbers and addresses do not. The filter tcp means "the packet has a TCP layer", and tcp.port alone means "the packet has this field" (useful to find packets that have a TCP header, with or without a given value).

You do not need to memorize field names. Select a field in the Packet Details tree, and the status bar shows its name. Right-click it and choose Apply as Filter > Selected (or Prepare as Filter, which fills the bar without applying). The Expression button on older versions and the autocomplete dropdown also list fields.

The filter bar colors

  • Green: the syntax is valid.
  • Red: an error; hover over it to read the message (a missing quote, an unknown field).
  • Yellow: valid, but probably not what you meant. For example ip.addr != 1.2.3.4 used to warn about its odd old meaning, or you used a deprecated syntax.

A valid filter that shows no packets simply matches none; maybe the traffic is not in the capture, or the value is wrong.

Using filters while you work

  • Bookmarks and buttons. The Save this filter button (a plus at the filter bar's end) stores it as a filter button on a toolbar, so one click applies it. The bookmark icon keeps a named list. Buttons are saved in your profile.
  • History. The arrow in the bar lists recent filters.
  • Combine by right-clicking a field and choosing ...and Selected, ...or Selected or ...and not Selected to extend the current filter.
  • Filter from the conversation. In Statistics > Conversations you can right-click a row and apply it as a filter.

A stand-in filter engine

Wireshark flattens each dissected packet into a set of named fields. This stand-in does the same with invented packets and evaluates the simplest kinds of filters (field, field == value, field > number). It shows why ip.addr can match both directions: a packet has two values for it.

Python Evaluate simple display filters (stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Discovering field names

Each field name has a clear pattern. The next stand-in flattens a nested packet into dotted names, the same way Wireshark builds names from protocol, field and subfield, so you can predict names before you look them up.

Python Flatten a packet into field names (stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Common beginner patterns

TEXT
http                                  all HTTP
http.response.code >= 400             HTTP errors
dns.flags.rcode != 0                  DNS errors (such as NXDOMAIN)
tcp.flags.syn == 1                    packets with SYN set
tcp.flags.reset == 1                  resets
icmp                                  ping and ICMP errors
arp                                   address resolution
frame.time_delta > 1                  more than 1 second since the previous packet

Where a field is a flag or boolean, tcp.flags.syn alone means "SYN is set" and !tcp.flags.syn means "not set". Hex numbers work (tcp.flags == 0x012 is SYN+ACK), and so do IP ranges written with a slash: ip.addr == 192.0.2.0/24.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which filter shows only packets sent by 192.0.2.10?

    ip.src matches the source address only. ip.addr matches either direction, and 'host' is capture-filter syntax.
  2. 2. The display filter bar is red. What should you do first?

    Red means a syntax error, and the tooltip tells you what is wrong.
  3. 3. How can you find the field name for a value you see in the Packet Details tree?

    Wireshark shows each field's name and writes the filter for you.
  4. 4. What does the filter 'tcp.port' (with no comparison) match?

    A bare field name tests that the field exists in the packet.

Summary

  • Display filters hide packets without deleting them; clear the filter to see everything again.
  • A protocol name filters by protocol; protocol.field == value filters by field.
  • Use the status bar and Apply as Filter to find field names; color shows valid (green), error (red) or suspicious (yellow).
  • ip.addr and tcp.port match either direction; use src/dst variants for one direction.
  • Save useful filters as buttons in your profile.

Next: Display Filter Operators and Logic