";
echo "
Date | ";
echo "IP | ";
echo "Status | ";
echo "Address | ";
echo "User | ";
echo "Destination | ";
echo "";
// Get Data from form post
$lines = $_POST['maxlines'];
$filter = $_POST['strfilter'];
if ($filter != "") {
$exprfilter = "| grep -i $filter";
} else {
$exprfilter = "";
}
// TODO FIX:
// Remove the hard link (maybe, get from config)
//
exec("tail -r -n $lines /var/squid/logs/access.log $exprfilter",$logarr);
foreach ($logarr as $logent) {
$logline = preg_split("/\s+/", $logent);
if ($filter != "")
$logline = preg_replace("/$filter/","$filter",$logline);
echo "\n";
echo "".date("d/m/y H:i:s",$logline[0])." | \n";
echo "".$logline[2]." | \n";
echo "".$logline[3]." | \n";
echo "".$logline[6]." | \n";
echo "".$logline[7]." | \n";
echo "".$logline[8]." | \n";
echo "
\n";
}
}
// Show SquidGuard Logs
function showSGuard() {
echo "";
echo "Date | ";
echo "Hour | ";
echo "ACL | ";
echo "Address | ";
echo "Host | ";
echo "User | ";
echo "
";
// Get Data from form post
$lines = $_POST['maxlines'];
$filter = $_POST['strfilter'];
if ($filter != "") {
$exprfilter = "| grep -i $filter";
} else {
$exprfilter = "";
}
// TODO FIX:
// Remove the hard link (maybe, get from config)
//
exec("tail -r -n $lines /var/squidGuard/log/block.log $exprfilter",$logarr);
foreach ($logarr as $logent) {
$logline = preg_split("/\s+/", $logent);
if ($filter != "")
$logline = preg_replace("/$filter/","$filter",$logline);
echo "\n";
echo "".$logline[0]." | \n";
echo "".$logline[1]." | \n";
echo "".$logline[3]." | \n";
echo "".$logline[4]." | \n";
echo "".$logline[5]." | \n";
echo "".$logline[6]." | \n";
echo "
\n";
}
}
?>