diff --git a/server.js b/server.js index 075fc8a..12e2ed9 100644 --- a/server.js +++ b/server.js @@ -101,24 +101,6 @@ function parseLogLines(data) { const logLines = data.split('\n'); const validLogs = []; - - logLines.forEach((line, index) => { - if (line.trim() !== '') { - try { - const jsonLine = line.trim() - .replace(/(\w+)="(.*?)"/g, '"$1":"$2"') // Wrap keys and string values in double quotes - .replace(/,(\s*)(?![^{}]*\})/g, ',$1"') // Add double quotes around any keys that follow a comma and are not inside braces - .replace(/(\w+):/g, '"$1":') // Wrap unquoted keys in double quotes - .replace(/=\s*/g, ': '); // Replace equals sign with colon - - const parsedLog = JSON.parse('{' + jsonLine + '}'); - validLogs.push(parsedLog); - } catch (parseError) { - console.error(`Error parsing log line at index ${index}: ${parseError.message}`); - } - } - }); - return validLogs; if (typeof value === 'string') { try {