diff --git a/html/includes/table/syslog.inc.php b/html/includes/table/syslog.inc.php
index 4093d935e..e06648b3a 100644
--- a/html/includes/table/syslog.inc.php
+++ b/html/includes/table/syslog.inc.php
@@ -29,7 +29,7 @@ if (!empty($_POST['to'])) {
if ($_SESSION['userlevel'] >= '5') {
$sql = 'FROM syslog AS S';
- $sql .= ' WHERE '.$where;
+ $sql .= ' WHERE '.$where . '1';
}
else {
$sql = 'FROM syslog AS S, devices_perms AS P ';
@@ -77,5 +77,6 @@ $output = array(
'rowCount' => $rowCount,
'rows' => $response,
'total' => $total,
+'sql' => $sql,
);
echo _json_encode($output);