Browse Source

export direct en CSV pour test graphEchantTabl

Citnop 3 years ago
parent
commit
ddc5b87834
1 changed files with 5 additions and 7 deletions
  1. 5 7
      genTrafic/genTrafic.py

+ 5 - 7
genTrafic/genTrafic.py

@@ -19,16 +19,14 @@ with open(f, 'w') as fw:
19 19
     for i in range(86400):
20 20
         #~ pq = "2016-09-18 14:21:45.244     0.000 TCP       88.224.34.18:443   ->     192.168.116.45:55817        1       52     1"
21 21
         pq = ""
22
-        pq += datetime.datetime.fromtimestamp(sec+i).strftime('%Y-%m-%d %H:%M:%S')
23
-        pq += ".000     1.000 TCP       "
22
+        pq += datetime.datetime.fromtimestamp(sec+i).strftime('%Y-%m-%d;%H:%M:%S')
23
+        pq += ".000;1.000;TCP;"
24 24
         pq += IPsrc
25
-        pq += ":443"
26
-        pq += "   ->     "
25
+        pq += ":443;;"
27 26
         pq += IPdst
28
-        pq += ":2048"
29
-        pq += "        1       "
27
+        pq += ":2048;1;"
30 28
         pq += str((i//3600)*10**5)
31
-        pq += "     1\n"
29
+        pq += ";1\n"
32 30
         fw.write(pq)
33 31
 
34 32