0
votes

For some automation purpose I have below requirements for the Wireshark log file(.pcap). 1-Conversion of Wireshark logs(.pcap file ) to text file with detail of packets. 2-Conversion of Wireshark logs (.pcap file) to text file with some filter (eg: bssgp.pdu_type == 0x00) with detail of packets.

I know how to convert the wireshark files to text file through GUI, But I need the cli commands for the same to automate the procedure.

Thanks in advance

1

1 Answers

0
votes

To convert a .pcap file to text output, you can run:

tshark -V -r file.pcap > file.txt

If you only want to convert certain packets that match a Wireshark display filter, then using your filter, you can run:

tshark -Y "bssgp.pdu_type == 0x00" -V -r file.pcap > file.txt

If the -V option provides too much detail, you can limit the detail to specific protocol(s) by using the -O option instead. For example, to provide details for bssgp only and a summary for all other protocols, try:

tshark -Y "bssgp.pdu_type == 0x00" -O bssgp -r file.pcap > file.txt

Refer to the tshark man page for more details about these options.