Select Git revision
table_TopSources.php
Forked from
713 / Warden / Warden - archive
Source project has a limited visibility.
table_TopSources.php 483 B
<?php
include("db.php");
$q = "select source, count(*) as events, sum(attack_scale) as totalScale from events where detected > from_unixtime(unix_timestamp(now())-3600*24*30) group by source order by totalScale desc limit 100;";
$res = mysql_query($q, $db);
if (mysql_num_rows($res) == 0) { die("nodata");}
$d = array();
while ($tmp = mysql_fetch_assoc($res)) {
array_push($d, $tmp);
}
mysql_free_result($res);
mysql_close($db);
print json_encode(array("aaData" => $d));
?>