refactor: use parser package for systemd logs
This commit is contained in:
parent
9aa1b7384d
commit
e468b3a0e3
13 changed files with 897 additions and 275 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue