Steps of Filtering and Building Display Filters in Wireshark (original) (raw)

Last Updated : 28 Apr, 2026

Wireshark supports two kinds of filters capture filters and display filters to help you record and analyze only the network traffic you need. This guide shows how to apply and build display filters to quickly find relevant packets in a capture.

Filter Types & Their Use

Filter Type When It Applies Effect
Capture Filter Before/during packet capture Only matching packets are saved to capture file
Display Filter After capture (or on loaded file) Only matching packets are shown, others hidden

Steps for Applying Filters While Viewing

To apply filters while viewing packets, follow the below steps:

TLS in wireshark

What Can You Filter By

The following factors can be used to apply effective filtering:

Wireshark Display Filter

Every field in the packet information pane can be used as a filter string to display only the packets that have that field.

Display filter option in wireshark

Display filter option in wireshark

Comparing Values

A variety of comparison operators can be used to create display filters that compare values.

Operator Meaning / Example
== (eq) Equal, ip.src == 12.0.1.7
!= (ne) Not equal, ip.src != 12.0.1.7
> (gt) Greater than, frame.len > 15
< (lt) Less than, frame.len < 64
>= (ge) Greater or equal, frame.len >= 0x100
<= (le) Less or equal, frame.len <= 0x20

Display Filter Field Types

Field Type Example
Unsigned Integer ip.len <= 1500, ip.len <= 0x436
Signed Integer Rare, similar syntax
Boolean Flag tcp.flags.syn
Ethernet Address eth.addr == ff:ff:ff:ff:ff:ff
IPv4 Address ip.addr == 192.168.0.1, ip.addr == 129.111.0.0/16
IPv6 Address ipv6.addr == ::1
IPX Address ipx.addr == 00000000.ffffffffffff
String http.request.uri == "/index.html"

Combining Expressions

Display Filter Logical Operations

The following table contains the full list of logical operators:

Operator Usage Example
and (&&) ip.src==10.0.0.1 and tcp.flags.fin
or (| )
xor (^^) tr.dst[0:3] == 0.6.29 xor tr.src[0:3] == 0.6.29
not (!) not llc
in http.request.method in {"GET","HEAD"}

Miscellaneous Operators

The following table contains the list of miscellaneous operators:

Operator Example & Meaning
Slice [n:m] eth.src[0:3] == 00:00:83 Matches the first 3 bytes of the source MAC address
Layer field#n ip.addr#2 == 192.168.40.60 Matches the 2nd occurrence of the IP layer
Layer range tcp.port#[2-4] Matches TCP ports in layers 2, 3 or 4

Arithmetic operators

Display Filter Arithmetic Operations

The following table contains the full list of arithmetic operators:

Operator Meaning
-A Unary minus
A + B Addition
A - B Subtraction
A × B Multiplication
A / B Division
A % B Modulo
A & B Bitwise AND

Curly braces are a common way to group mathematical expressions.

Functions

There are several functions to convert fields in the display filter language.

Function Example / Meaning
upper() upper(http.server) convert to uppercase
lower() lower(http.server) contains "apache"
len() len(http.request.uri) > 100 (length in bytes)
count() count(ip.addr) > 2 multiple IP fields
string() string(frame.number) matches "[13579]$"
max() max(tcp.srcport, tcp.dstport) <= 1024
min() min(tcp.srcport, tcp.dstport) <= 1024
abs() abs(tcp.srcport)