Update export_log.php

This commit is contained in:
jakani24
2024-04-27 13:14:40 +02:00
parent 1a2aba9ca9
commit 4f710991fe

View File

@@ -69,7 +69,7 @@ $filter_query = "&loglevel=$loglevel&logtext=$logtext&machine_id=$machine_id&tim
$fp=fopen("/var/www/html/export/cyberhex_log_export.csv","w"); $fp=fopen("/var/www/html/export/cyberhex_log_export.csv","w");
//do all the logic here and write into file //do all the logic here and write into file
// Query log entries for the export file with filters // Query log entries for the export file with filters
$sql = "SELECT * FROM machines,log WHERE machine_location LIKE ? AND loglevel LIKE ? AND logtext LIKE ? AND machine_id LIKE ? AND time LIKE ? AND machine_name=machine_id ORDER BY log.id DESC LIMIT ?, ?"; $sql = "SELECT * FROM machines,log WHERE machine_location LIKE ? AND loglevel LIKE ? AND logtext LIKE ? AND machine_id LIKE ? AND time LIKE ? AND machine_name=machine_id ORDER BY log.id DESC";
$stmt = $conn->prepare($sql); $stmt = $conn->prepare($sql);
$loglevel = "%" . $loglevel . "%"; $loglevel = "%" . $loglevel . "%";
$logtext = "%" . $logtext . "%"; $logtext = "%" . $logtext . "%";