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

How to sort IP addresses by numerical order?

0

I want to sort IP addresses so that in ascending order, I get 10.0.0.1, 10.0.0.2, 10.0.0.3, etc.

Currently wireshark sorts by default to lexicographical order, i.e 10.0.0.1, 10.0.0.11, 10.0.0.12, 10.0.0.2, etc.

Is this possible in wireshark currently? Google and poking around in preferences yielded nothing.

Currently using wireshark 1.10.6.

asked 26 Jan '15, 18:43

fruglemonkey's gravatar image

fruglemonkey
11225
accept rate: 0%


One Answer:

0

You can script this with tshark and sort. For example:

tshark -r file.pcap -T fields -e ip.src | sort -u -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4

EDIT: Using "Statistics -> Endpoint List -> IPv4" or "Statistics -> Endpoints -> IPv4" works as expected, but the behavior is wrong when sorting by the Packet Details "Source" or "Destination" IP address columns. You may want to open a bug report for that incorrect sort behavior.

answered 31 Jan '15, 13:57

cmaynard's gravatar image

cmaynard ♦♦
9.4k1038142
accept rate: 20%

edited 04 Feb '15, 09:42