diff --git a/pkg/convox/frame.go b/pkg/convox/frame.go index f0f83f9..7c438c2 100644 --- a/pkg/convox/frame.go +++ b/pkg/convox/frame.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/Schibsted-Tech-Polska/convox-logs-parser/pkg/formats" "strings" + "time" ) type convoxFrame struct { @@ -14,10 +15,19 @@ type convoxFrame struct { func getConvoxFrame(s string) convoxFrame { var sp = strings.Split(s, " ") - var cf = convoxFrame{ - sp[0], - sp[1], - formats.New(strings.Join(sp[2:], " ")), + var cf convoxFrame + if len(sp) > 2 { + cf = convoxFrame{ + sp[0], + sp[1], + formats.New(strings.Join(sp[2:], " ")), + } + } else { + cf = convoxFrame{ + time.Now().String(), + "error/parsing", + formats.New(s), + } } return cf