refactor: use parser package for systemd logs

This commit is contained in:
Patryk Hegenberg 2025-09-25 00:01:34 +02:00
parent 9aa1b7384d
commit e468b3a0e3
13 changed files with 897 additions and 275 deletions

View file

@ -7,6 +7,7 @@ import (
"regexp"
"strconv"
"strings"
"tixel_watch/helpers"
"tixel_watch/models"
"github.com/hpcloud/tail"
@ -175,7 +176,7 @@ func (p *NginxTJMLogParser) parseNginxTJM(entry models.LogMessage) models.LogMes
if len(parts) > 0 {
timestampStr := strings.Trim(parts[0], "[]")
timestamp, err := parseRFC3339WithOptionalZ(timestampStr)
timestamp, err := helpers.ParseRFC3339WithOptionalZ(timestampStr)
if err != nil {
slog.Error("unable to parse time", "error", err)
}