summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Langesten <daniel.langest@gmail.com>2015-03-17 14:27:56 +0100
committerDaniel Langesten <daniel.langest@gmail.com>2015-03-17 14:27:56 +0100
commit49fd768b0e7018d314eebcb86a67a865ac5e1d9b (patch)
tree34a92e25f774c0b9557b0bcb2cbfc4e5b618727f
parent1795c1ae12d41260a3a5fb5fbc0c4c8e4128e4b4 (diff)
started to remake testdata
-rw-r--r--dbSetup/dbTestData.mysql45
-rw-r--r--dbSetup/dbtestdata.sql11
2 files changed, 45 insertions, 11 deletions
diff --git a/dbSetup/dbTestData.mysql b/dbSetup/dbTestData.mysql
new file mode 100644
index 0000000..ccc6c65
--- /dev/null
+++ b/dbSetup/dbTestData.mysql
@@ -0,0 +1,45 @@
+drop database if exists test;
+create database test;
+
+USE test;
+
+drop table if exists test_raw;
+ create table test_raw (
+ ip_src CHAR(39) NOT NULL,
+ ip_dst CHAR(39) NOT NULL,
+ as_src INT(4) UNSIGNED NOT NULL,
+ as_dst INT(4) UNSIGNED NOT NULL,
+ port_src INT(2) UNSIGNED NOT NULL,
+ port_dst INT(2) UNSIGNED NOT NULL,
+ packets INT UNSIGNED NOT NULL,
+ bytes INT UNSIGNED NOT NULL,
+ pkt_len_distrib CHAR(10) NOT NULL,
+ stamp_inserted DATETIME NOT NULL,
+ stamp_updated DATETIME,
+ stamp_processed DATETIME,
+ PRIMARY KEY (ip_src, ip_dst, as_src, as_dst, port_src, port_dst, pkt_len_distrib, stamp_inserted)
+);
+
+DROP TABLE IF EXISTS test_clean;
+
+CREATE TABLE test_clean (
+ ipb_src CHAR(39) NOT NULL,
+ ipb_dst CHAR(39) NOT NULL,
+ as_src INT(4) UNSIGNED NOT NULL,
+ as_dst INT(4) UNSIGNED NOT NULL,
+ port_src INT(2) UNSIGNED NOT NULL,
+ port_dst INT(2) UNSIGNED NOT NULL,
+ occurences INT UNSIGNED NOT NULL,
+ volume CHAR(10) NOT NULL,
+ time_added DATETIME NOT NULL,
+ time_privatized DATETIME,
+ UNIQUE idx (ipb_src, ipb_dst, as_src, as_dst, port_src, port_dst, volume, time_added)
+);
+
+grant all privileges on test.* to flowcleaner@localhost identified by 'nil' with grant option;
+grant all privileges on test.* to pmacct@localhost identified by 'arealsmartpwd' with grant option;
+-- New data that should not be processed in case there is more that should be aggregated together with it.
+INSERT INTO raw_data (ip_src, ip_dst, time, port, packet_size) VALUES ("123.123.123.123", "12.12.12.12", NOW(), 80, 255);
+
+-- Old data that should be processed
+INSERT INTO raw_data (ip_src, ip_dst, time, port, packet_size) VALUES ("63.63.63.63", "73.73.73.73", '2008-12-01 12:00:00', 80, 200);
diff --git a/dbSetup/dbtestdata.sql b/dbSetup/dbtestdata.sql
deleted file mode 100644
index 7f877f1..0000000
--- a/dbSetup/dbtestdata.sql
+++ /dev/null
@@ -1,11 +0,0 @@
--- New data that should not be processed in case there is more that should be aggregated together with it.
-INSERT INTO raw_data (ip_src, ip_dst, time, port, packet_size) VALUES ("123.123.123.123", "12.12.12.12", NOW(), 80, 255);
-INSERT INTO raw_data (ip_src, ip_dst, time, port, packet_size) VALUES ("123.123.123.123", "12.12.12.12", NOW(), 80, 255);
-INSERT INTO raw_data (ip_src, ip_dst, time, port, packet_size) VALUES ("45.45.45.45", "12.12.12.12", NOW(), 80, 255);
-
--- Old data that should be processed
-INSERT INTO raw_data (ip_src, ip_dst, time, port, packet_size) VALUES ("63.63.63.63", "73.73.73.73", '2008-12-01 12:00:00', 80, 200);
-INSERT INTO raw_data (ip_src, ip_dst, time, port, packet_size) VALUES ("63.63.63.63", "73.73.73.73", '2008-12-01 12:00:00', 80, 200);
-INSERT INTO raw_data (ip_src, ip_dst, time, port, packet_size) VALUES ("8.8.8.8", "11.73.73.73", '2008-12-01 12:00:00', 80, 200);
-INSERT INTO raw_data (ip_src, ip_dst, time, port, packet_size) VALUES ("63.63.63.63", "73.73.73.73", '2008-12-01 12:00:00', 80, 200);
-INSERT INTO raw_data (ip_src, ip_dst, time, port, packet_size) VALUES ("100.63.63.63", "8.8.8.8", '2008-12-01 12:00:00', 80, 200);