从wireshark绘制csv文件 [英] Plotting a csv file from wireshark

查看:65
本文介绍了从wireshark绘制csv文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将Wireshark嗅探器捕获文件另存为csv.所有元素都保存在双引号内.我试图在相同的位置绘制图形.csv文件和gnuplot代码已给出.所有值都归到单个xtic标签上.有人可以帮助我提供一种解决方法,以使用数据文件中的双引号进行绘制.

I saved a wireshark sniffer capture file as csv. All the elements are saved within the double quotation. I am trying to plot the graph over the same. csv file and the gnuplot code is given. All the values came up to a single xtic label. Can someone help me giving a workaround to plot using the doublequotes in the data file.

data.csv

"No.",Time",Source,Destination,Protocol
"2",0.000252",192.168.1.183,224.0.0.251,MDNS
"3",0.000553",192.168.1.183,224.0.0.251,MDNS
"4",0.00102",192.168.1.183,224.0.0.251,MDNS
"6",0.10285",192.168.1.183,224.0.0.251,MDNS
"9",0.307653",192.168.1.183,224.0.0.251,MDNS
"12",0.512459",192.168.1.183,224.0.0.251,MDNS
"15",0.717208",192.168.1.183,224.0.0.251,MDNS
"1876",57.027387",,Cisgram_89:0c:e9 (00:77:4c:89:0c:e9) (RA),802.11
"1878",57.051959",,Cisgram_89:0c:e9 (00:77:4c:89:0c:e9) (RA),802.11
"1879",57.076533",,Cisgram_89:0c:e9 (00:77:4c:89:0c:e9) (RA),802.11
"1880",57.101105",,Cisgram_89:0c:e9 (00:77:4c:89:0c:e9) (RA),802.11
"1881",57.125798",,Cisgram_89:0c:e9 (00:77:4c:89:0c:e9) (RA),802.11
"1883",57.150375",,Cisgram_89:0c:e9 (00:77:4c:89:0c:e9) (RA),802.11
"1884",57.174908",,Cisgram_89:0c:e9 (00:77:4c:89:0c:e9) (RA),802.11
"1885",57.199418",,Cisgram_89:0c:e9 (00:77:4c:89:0c:e9) (RA),802.11
"1886",57.223989",,Cisgram_89:0c:e9 (00:77:4c:89:0c:e9) (RA),802.11
"1888",57.248572",,Cisgram_89:0c:e9 (00:77:4c:89:0c:e9) (RA),802.11
"1889",57.273146",,Cisgram_89:0c:e9 (00:77:4c:89:0c:e9) (RA),802.11
"1890",57.297719",,Cisgram_89:0c:e9 (00:77:4c:89:0c:e9) (RA),802.11
"1891",57.322295",,Cisgram_89:0c:e9 (00:77:4c:89:0c:e9) (RA),802.11
"1893",57.347335",,Cisgram_89:0c:e9 (00:77:4c:89:0c:e9) (RA),802.11
"1894",57.371452",,Cisgram_89:0c:e9 (00:77:4c:89:0c:e9) (RA),802.11
"1895",57.396097",,Cisgram_89:0c:e9 (00:77:4c:89:0c:e9) (RA),802.11
"1896",57.420663",,Cisgram_89:0c:e9 (00:77:4c:89:0c:e9) (RA),802.11
"1898",57.445152",,Cisgram_89:0c:e9 (00:77:4c:89:0c:e9) (RA),802.11
"1899",57.469746",,Cisgram_89:0c:e9 (00:77:4c:89:0c:e9) (RA),802.11
"1900",57.494326",,Cisgram_89:0c:e9 (00:77:4c:89:0c:e9) (RA),802.11
"1901",57.518902",,Cisgram_89:0c:e9 (00:77:4c:89:0c:e9) (RA),802.11
"1902",57.543474",,Cisgram_89:0c:e9 (00:77:4c:89:0c:e9) (RA),802.11

gnuplot> reset
gnuplot> set datafile separator ","
gnuplot> set xdata time
gnuplot> set timefmt '"%s.%.6s"'
gnuplot> set xtic rotate 90
gnuplot>
gnuplot> plot 'data.csv' u 2:1:xtic(2) w linespoint
Warning: empty x range [0:0], adjusting to [-1:1]
gnuplot>

推荐答案

如果您的时间以秒为单位,而您想以秒为单位绘制x轴,则无需使用 set xdata time .除非您希望以分钟或小时为单位显示x轴单位.除此之外,在两种情况下都不需要使用 xtic(2).gnuplot将第2列解释为浮点数,而忽略了".

If your time is in seconds and you want to plot the x-axis in seconds then there is no need to use set xdata time. Unless you want the x-axis units displayed in minutes or hours. Independent of that, using xtic(2) is also not needed in both cases. gnuplot is interpreting column 2 as floating point number ignoring the ".

如果我正确地假设要绘制什么,则您的plot命令将简单地是:

If I correctly assume what you want to plot, your plot command would simply be:

plot $Data  u 2:1 with linespoints

这篇关于从wireshark绘制csv文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆