

Then I print the packet count by protocolįinally I divide the total packet size by the packet count to find the average packet size

I divid by 1024/1024 to convert bytes to MBytes Then I calculate the sum of total_length for each protocol and display it in a bar plot. We see that most packets are between 14 bytes Then I do a histogram for tcp packets total_length and udp packets total_length. Next I am just replacing column names that have spaces with _ for better manipulation On cell 5 I am going to keep all rows that the source is not my pc, because I am interested in incoming traffic.Ĭell 26: I do a groupby(‘Protocol’) and count(), this will print the packets per protocol, since each line is a packet.Ĭell 27: I can also sort_values and I see that the most packet are by UDP and TCP as expected then I print the first 5 rows to see how my data looks like. I have added some columns like total_length of ip packet and tcp segment size.įirst I read the csv file (cell 1) into a pandas dataframe df. The columns that you want to appear in csv, must be visible on wireshack. Then I go to File, Export packet dissections, as CSV. I left wireshark run for a couple of mins. You can do with pandas whatever you can do with Excell, but usually faster.įirst we will capture some packets from wireshark. Import data into ElasticsearchĬat trace.Pandas is a python package that is used for data analysis. (OPTIONAL) Delete current data in ElasticsearchĬurl -XDELETE ' 4. Tshark -T ek -no-duplicate-keys -r trace.pcap > trace.jsonģ. The process can be quickly summarized in the following steps:įor example for Ubuntu follow this tutorialĮxample for all fields for Elasticsearch 5.X and older The description of tshark export into elasticsearch json is described here. The pcap can be first imported into elasticsearch by using tshark. Kibana can be well suited for creating various dashboards for analyzing of the network capture. Tshark + Elasticsearch + Kibana dashboards
