Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Converting Pcap file to CSV file while defautly keeping all features/fields defined in pcap

Hi all, I have been searching for solutions that can transform PCAP files to CSV format while keeping all the details defined in the pcap file, without explicitly defining which features/fields that i want to include in CSV format.

With Wireshark&Tshark, i have tested the following two ways:

  1. the first one is to use tshark commands such as:

    tshark -r traffic.pcap > traffic.csv

    tshark -r traffic.pcap -T fields -e ip.src -E separator=, -E occurrence=f > traffic.csv

    In any case, the traffic.csv contains only general information (e.g., No., Time, Source, Destination, Length, Protocol, Info) of the traces without any packet detail(Packet Bytes).

  2. I also tried with Wireshark by selecting Export Packet Dissections, however i got differet results by exporting the same pcap file to csv, json, and plain text format. In general, the exported csv file still contains only general information of packets, without packet detail (Packet Bytes), even i selected the field (Packet Bytes during export).

I wonder if there is a way i can also have the the details of each packet in the csv file? Thanks.