Skip to content

[receiver/syslog] rfc6587 is overwritting each parsed event #23577

Closed
@timannguyen

Description

@timannguyen

Component(s)

receiver/syslog

What happened?

Description

syslog receiver is incorrectly breaking RFC6587 events. currently it's using influxdata syslog parser where each event is correctly parsed https://github.com/influxdata/go-syslog/blob/develop/octetcounting/parser.go#L124-L132. However, the parsed object is getting overridden each time https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/pkg/stanza/operator/parser/syslog/syslog.go#L316-L319. It is expected that the octet parser to return all parsed events rather than just the last.

Steps to Reproduce

when sending 4 events of the following with framing to the syslog receiver:

79 <6>1 2023-06-20T12:25:03-04:00 testEvent functional-test 65644 test - testEvent

it would be bundled to a single event without the newline:

79 <6>1 2023-06-20T12:25:03-04:00 testEvent functional-test 65644 test - testEvent
79 <6>1 2023-06-20T12:25:03-04:00 testEvent functional-test 65644 test - testEvent
79 <6>1 2023-06-20T12:25:03-04:00 testEvent functional-test 65644 test - testEvent
79 <6>1 2023-06-20T12:25:03-04:00 testEvent functional-test 65644 test - testEvent

Expected Result

it would expected there would be 4 events of

79 <6>1 2023-06-20T12:25:03-04:00 testEvent functional-test 65644 test - testEvent

Actual Result

one event of:

79 <6>1 2023-06-20T12:25:03-04:00 testEvent functional-test 65644 test - testEvent79 <6>1 2023-06-20T12:25:03-04:00 testEvent functional-test 65644 test - testEvent79 <6>1 2023-06-20T12:25:03-04:00 testEvent functional-test 65644 test - testEvent79 <6>1 2023-06-20T12:25:03-04:00 testEvent functional-test 65644 test - testEvent

Collector version

0.74.0

Environment information

Environment

OS: MAC OS, Ubuntu 22.04

OpenTelemetry Collector configuration

receivers:
  syslog/default: 
    enable_octet_counting: true
    protocol: rfc5424,
    tcp: 
      listen_address: 0.0.0.0:9998

Log output

No response

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions