Skip to content

Commit

Permalink
Fix(exporter): fix parser to also parse the timestamp in a single log…
Browse files Browse the repository at this point in the history
… line
  • Loading branch information
sharkpc138 committed Nov 4, 2024
1 parent 2167a1b commit e3ea9e0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/lobster/sink/exporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (
"github.com/naver/lobster/pkg/lobster/sink/order"
"github.com/naver/lobster/pkg/lobster/store"
"github.com/naver/lobster/pkg/lobster/util"
"github.com/pkg/errors"

sinkV1 "github.com/naver/lobster/pkg/operator/api/v1"
)
Expand Down Expand Up @@ -248,7 +249,12 @@ func parseStart(data []byte) (time.Time, error) {
func parseEnd(data []byte) (time.Time, error) {
index := bytes.LastIndexAny(data[:len(data)-2], "\n")
if index < 0 {
return time.Time{}, fmt.Errorf("failed to parse end")
t, err := logline.ParseTimestamp(string(data))
if err != nil {
return time.Time{}, errors.Wrap(err, "failed to parse end")
}

return t, nil
}

return logline.ParseTimestamp(string(data[index+1:]))
Expand Down

0 comments on commit e3ea9e0

Please sign in to comment.