Skip to content

Commit

Permalink
fix: fixes empty blank links to not show up as json (#3324)
Browse files Browse the repository at this point in the history
  • Loading branch information
amir20 authored Oct 12, 2024
1 parent 5e33094 commit 2c2e3d5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/docker/event_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ func createEvent(message string, streamType StdType) *LogEvent {
logEvent.Timestamp = timestamp.UnixMilli()
message = strings.TrimSuffix(message[index+1:], "\n")
logEvent.Message = message
if json.Valid([]byte(message)) {
if message == "" {
logEvent.Message = "" // empty message so do nothing
} else if json.Valid([]byte(message)) {
data := orderedmap.New[string, any]()
if err := json.Unmarshal([]byte(message), &data); err != nil {
var jsonErr *json.UnmarshalTypeError
Expand Down

0 comments on commit 2c2e3d5

Please sign in to comment.