Skip to content
Snippets Groups Projects
Commit ab468508 authored by root's avatar root
Browse files

ui bugfix: do generovanych grafu muze prijit velke mnozstvi dat,

pri defaultnich zobrazenich oriznu na 1000 radek. ostatni maji
zatim alertuji pres js
parent f271d6cd
No related branches found
No related tags found
No related merge requests found
......@@ -16,9 +16,14 @@ switch( $_GET['per']) {
}
#sqli todo
#limits
$limit="";
#selector
if(!IsSet($_GET['where'])) {
$where="detected>from_unixtime(0)";
$where="1=1";
$limit="order by detected desc limit 1000";
} else {
$where = base64_decode($_GET['where']);
}
......@@ -51,7 +56,7 @@ $count_cols=count($cols);
$data=array();
#casova posloupnost
# premapuju podle staticky alokovanych sloupcu, posilam to rovnou do grafu
$q = "SELECT unix_timestamp(detected)-(unix_timestamp(detected)%(3600*$agg)) as t, concat_ws('-',$query_cols) as col, count(*) as count FROM events WHERE $where GROUP BY $query_cols, t;";
$q = "SELECT unix_timestamp(detected)-(unix_timestamp(detected)%(3600*$agg)) as t, concat_ws('-',$query_cols) as col, count(*) as count FROM events WHERE $where GROUP BY $query_cols, t $limit";
#var_dump($q);
$res = mysql_query($q, $db);
while ($tmp = mysql_fetch_assoc($res)) {
......
......@@ -16,9 +16,14 @@ switch( $_GET['per']) {
}
#sqli todo
#limits
$limit="";
#selector
if(!IsSet($_GET['where'])) {
$where="detected>from_unixtime(0)";
$where="1=1";
$limit="order by detected desc limit 1000";
} else {
$where = base64_decode($_GET['where']);
}
......@@ -51,7 +56,7 @@ $count_cols=count($cols);
$data=array();
#casova posloupnost
# premapuju podle staticky alokovanych sloupcu, posilam to rovnou do grafu
$q = "SELECT unix_timestamp(detected)-(unix_timestamp(detected)%(3600*$agg)) as t, concat_ws('-',$query_cols) as col, sum(attack_scale) as totalScale FROM events WHERE $where GROUP BY $query_cols, t;";
$q = "SELECT unix_timestamp(detected)-(unix_timestamp(detected)%(3600*$agg)) as t, concat_ws('-',$query_cols) as col, sum(attack_scale) as totalScale FROM events WHERE $where GROUP BY $query_cols, t $limit";
#var_dump($q);
$res = mysql_query($q, $db);
while ($tmp = mysql_fetch_assoc($res)) {
......
......@@ -17,7 +17,8 @@ switch( $_GET['per']) {
#sqli todo
#selector
$where="detected>from_unixtime(0)";
$where="1=1";
$limit="order by detected desc limit 1004";
$query_cols = "type";
......@@ -46,7 +47,7 @@ $count_cols=count($cols);
$data=array();
#casova posloupnost
# premapuju podle staticky alokovanych sloupcu, posilam to rovnou do grafu
$q = "SELECT unix_timestamp(detected)-(unix_timestamp(detected)%(3600*$agg)) as t, concat_ws('-',$query_cols) as col, count(*) as count FROM events WHERE $where GROUP BY $query_cols, t;";
$q = "SELECT unix_timestamp(detected)-(unix_timestamp(detected)%(3600*$agg)) as t, concat_ws('-',$query_cols) as col, count(*) as count FROM events WHERE $where GROUP BY $query_cols, t $limit";
#var_dump($q);
$res = mysql_query($q, $db);
while ($tmp = mysql_fetch_assoc($res)) {
......
......@@ -17,7 +17,8 @@ switch( $_GET['per']) {
#sqli todo
#selector
$where="detected>from_unixtime(0)";
$where="1=1";
$limit="order by detected desc limit 1003";
$query_cols = "type";
......@@ -46,7 +47,7 @@ $count_cols=count($cols);
$data=array();
#casova posloupnost
# premapuju podle staticky alokovanych sloupcu, posilam to rovnou do grafu
$q = "SELECT unix_timestamp(detected)-(unix_timestamp(detected)%(3600*$agg)) as t, concat_ws('-',$query_cols) as col, sum(attack_scale) as totalScale FROM events WHERE $where GROUP BY $query_cols, t;";
$q = "SELECT unix_timestamp(detected)-(unix_timestamp(detected)%(3600*$agg)) as t, concat_ws('-',$query_cols) as col, sum(attack_scale) as totalScale FROM events WHERE $where GROUP BY $query_cols, t $limit";
#var_dump($q);
$res = mysql_query($q, $db);
while ($tmp = mysql_fetch_assoc($res)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment