diff --git a/receiver/fluentforwardreceiver/conversion.go b/receiver/fluentforwardreceiver/conversion.go index 1a9233ba195c..a57d9a972a7e 100644 --- a/receiver/fluentforwardreceiver/conversion.go +++ b/receiver/fluentforwardreceiver/conversion.go @@ -133,6 +133,8 @@ func parseToAttributeValue(val interface{}, dest pcommon.Value) { func timeFromTimestamp(ts interface{}) (time.Time, error) { switch v := ts.(type) { + case uint64: + return time.Unix(int64(v), 0), nil case int64: return time.Unix(v, 0), nil case *eventTimeExt: diff --git a/receiver/fluentforwardreceiver/conversion_test.go b/receiver/fluentforwardreceiver/conversion_test.go index 06974289c59d..f15e99de8d79 100644 --- a/receiver/fluentforwardreceiver/conversion_test.go +++ b/receiver/fluentforwardreceiver/conversion_test.go @@ -165,17 +165,6 @@ func TestMessageEventConversionWithErrors(t *testing.T) { require.NotNil(t, err) }) } - - t.Run("Invalid timestamp type uint", func(t *testing.T) { - in := make([]byte, len(b)) - copy(in, b) - in[8] = 0xcd - reader := msgp.NewReader(bytes.NewReader(in)) - - var event MessageEventLogRecord - err := event.DecodeMsg(reader) - require.NotNil(t, err) - }) } func TestForwardEventConversionWithErrors(t *testing.T) { diff --git a/unreleased/fluentforwardreceiver-uint64-fix.yaml b/unreleased/fluentforwardreceiver-uint64-fix.yaml new file mode 100755 index 000000000000..479b229ab754 --- /dev/null +++ b/unreleased/fluentforwardreceiver-uint64-fix.yaml @@ -0,0 +1,16 @@ +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: bug_fix + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: fluentforwardreceiver + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: added case to handle uint64 timestamp + +# One or more tracking issues related to the change +issues: [ 11435 ] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: