Ask Your Question

Use display filter functions in column definitions

asked 2019-08-11 19:32:18 +0000

Chuckc gravatar image

I can create a display filter to display frames with more than one expert info:


Would be nice to be able to add a column count( to sort on and have available when analyzing.

There doesn't seem to be a length field for tcp.options so a column len(tcp.options) would be nice. TCP options aren't broken down into occurrences so something like count(tcp.option_len) (doesn't count NOPs) to compare different TCP handshakes.

Don't have a use case for upper, lower or string but include for completeness? Each use would be standalone - not dependent on other packets or fields - so maybe just an extension of the column definition language?

6.4.6. Functions
The display filter language has a number of functions to convert fields, see Table 6.7, “Display Filter Functions”.
Table 6.7. Display Filter Functions
Function    Description
upper        Converts a string field to uppercase.
lower        Converts a string field to lowercase.
len            Returns the byte length of a string or bytes field.
count        Returns the number of field occurrences in a frame.
string        Converts a non-string field to a string.
edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2019-08-11 20:10:26 +0000

grahamb gravatar image

Enhancement requests should be made over at the Wireshark Bugzilla.

edit flag offensive delete link more


Thanks for looking at this. Wanted to give it a trial run before opening a ER.

Chuckc gravatar imageChuckc ( 2019-08-12 20:59:43 +0000 )edit

And it's bug 15990.

Guy Harris gravatar imageGuy Harris ( 2019-08-13 01:41:06 +0000 )edit

answered 2019-08-11 21:52:19 +0000

Ross Jacobs gravatar image

Wireshark Bugzilla is the appropriate place for feature requests.

In the interim, this script may help you. This will create a file each for every number of expert infos using tshark, so if you see an expert_infos5.pcapng, it will only have packets with 5 expert infos.

#!/usr/bin/env bash
while [[ $hits > 0 ]]; do
    tshark -r $source -Y "count( > ${i}" -w expert_infos${i}.pcapng
    hits=$(tshark -r /tmp/expert_infos${i}.pcapng | wc -l)

My capture only had 1 type of expert infos per packet, so I only see one file:

$bash ls /tmp | grep export_infos
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2019-08-11 19:32:18 +0000

Seen: 1,033 times

Last updated: Aug 11 '19