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

Is there a way to add a comment to packets in command line?

0
1

I was reading this wireshark user guide and found that you can add comments to a pcapng capture file, but so far I haven't been able to do it, I tried everything but nothing seems to work, can someone explain me how to do it?

bash $ tshark -r e.pcapng -comment hey

tshark: The specified packet count "omment" isn't a decimal number


This is the part of the page that shows that it is possible:

capture-comment <comment>

add a capture comment to the newly created

output file (only for pcapng)

asked 30 Apr '15, 07:45

pier's gravatar image

pier
6122
accept rate: 0%


2 Answers:

0

Looks like you cannot add comments to existing files. I just tried, and this is what happenend:

[D:\Traces]tshark -r "HTTP Sample Test.pcapng" --capture-comment "Test for Q&A" -w "HTTP Sample Test commented.pcapng"
tshark: A capture comment was specified, but a capture isn't being done.
There's no support for adding a capture comment to an existing capture file.

[D:\Traces]

answered 30 Apr ‘15, 07:53

Jasper's gravatar image

Jasper ♦♦
23.8k551284
accept rate: 18%

edited 30 Apr ‘15, 07:54

I tried capturing a new file but still nothing, I’m using a raspberry pi by the way with raspbian (linux) so I don’t know if I don’t have that option =P

bash$ sudo tshark -c 3 -i wlan0 –capture-comment “Test for Q&A” -w e.pcapng

tshark: invalid option – ‘-'

TShark 1.8.2

Dump and analyze network traffic.

(30 Apr ‘15, 08:05) pier

This works on Windows with 1.12.4

(30 Apr ‘15, 08:25) grahamb ♦

yeah, I just checked the man page and it seems that that option is not available for linux distributions, at least not mine =P

(30 Apr ‘15, 09:06) pier
1

You’ll need a more up to date version. If .deb based you can try the wireshark-dev ppa.

(30 Apr ‘15, 10:03) grahamb ♦

0

although not on the command line, you can do it in Wireshark

Statistics -> Summary -> Capture File Comments

If you save the file, the comments will be added to the pcapgng file.

Regards
Kurt

answered 30 Apr '15, 08:08

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
24.8k1039237
accept rate: 15%

edited 30 Apr '15, 08:10