fix: syslog parser TS strict null check, deploy script

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Michal
2026-03-29 00:58:00 +00:00
parent 84f1a7b133
commit aae03d9877
2 changed files with 75 additions and 1 deletions

View File

@@ -18,7 +18,7 @@ function parseSyslogLine(raw: string): { program: string; message: string } {
// Try to extract program and message after the timestamp + hostname
// RFC 3164: "Mon DD HH:MM:SS HOSTNAME PROGRAM[PID]: MESSAGE"
const match = noPri.match(/^\w+\s+\d+\s+[\d:]+\s+\S+\s+(\S+?)(?:\[\d+\])?:\s*(.*)/);
if (match) {
if (match?.[1] && match[2] !== undefined) {
return { program: match[1], message: match[2] };
}
// Fallback: just return the whole line