Check a display filter
check_filterValidates a Wireshark display filter without reading a capture, returning compile errors, offsets, warnings, and field names so you can fix syntax before passing it to another tool.
Instructions
Check a Wireshark display filter without reading any capture: tshark compiles it
against an empty capture and its own error comes back in errors, with error_at
giving the offset and length of the part it points at (e.g. "nosuch.field" is not a valid protocol or protocol field, "0x100000000" too big for this field). When
dftest is installed beside tshark, its warnings (deprecated names such as "ssl" or
"bootp") come back in filter_warnings; warnings_checked says whether it ran.
fields lists the fields and protocols the filter names, with their types. The
server's own lint (no ;, backquote or $ outside quotes, ||/&& rather than a
single |/&, no control characters) is applied first. Use it before passing a
filter to another tool.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"filter": "<filter>"
},
"name": "check_filter"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | Yes | Display filter to check | |
| redact | No | Replace subscriber identifiers in this result with tokens; ids+ips hides every IP too | off |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | ||
| valid | No | ||
| errors | No | ||
| fields | No | rows with keys: field, name, type, protocol, display, description | |
| filter | No | ||
| window | No | ||
| error_at | No | keys: offset, length | |
| rejected_by | No | ||
| filter_warnings | No | ||
| warnings_checked | No |