Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
timannguyen opened this issue Jun 20, 2023 · 7 comments
Closed

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

timannguyen opened this issue Jun 20, 2023 · 7 comments
Assignees
Labels
bug Something isn't working receiver/syslog Stale

Comments

@timannguyen
Copy link
Contributor

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

@timannguyen timannguyen added bug Something isn't working needs triage New item requiring triage labels Jun 20, 2023
@github-actions
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@djaglowski
Copy link
Member

@timannguyen, thanks for reporting this. Will you be able to make a pull request for it?

@djaglowski djaglowski removed the needs triage New item requiring triage label Jun 20, 2023
@timannguyen
Copy link
Contributor Author

@djaglowski i will. thank you for checking.

@timannguyen
Copy link
Contributor Author

@djaglowski would adding something like adding in ParserOperator:

ProcessMultiEventsWithCallback(same args as ProcessWithCallback)
  entries, err := ParseWithMultiEvents(args)
  for entry in entries
     write(entry)

ParseWithMultiEvents(same arg as ParseWith) ([]entry.entry, err)

i will refactor other funcs to ensure minimal duplication. if that is sensible, i'll move forward with that.

cc: @splunkericl

@djaglowski
Copy link
Member

@timannguyen I don't have an understanding of the failure mechanism yet so can't say what a good solution looks like. I recommend a minimal solution be proposed and then we can refactor to reduce duplication if it looks good.

@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Aug 21, 2023
@djaglowski
Copy link
Member

Closed by #23645

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working receiver/syslog Stale
Projects
None yet
Development

No branches or pull requests

2 participants