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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

GELF decoder's default framer with TCP input does not match the encoder's default #20768

Open
jorgehermo9 opened this issue Jul 2, 2024 · 3 comments 路 May be fixed by #20778
Open

GELF decoder's default framer with TCP input does not match the encoder's default #20768

jorgehermo9 opened this issue Jul 2, 2024 · 3 comments 路 May be fixed by #20778
Labels
domain: codecs Anything related to Vector's codecs (encoding/decoding) type: bug A code related bug.

Comments

@jorgehermo9
Copy link

jorgehermo9 commented Jul 2, 2024

A note for the community

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Problem

As discussed in #18008, the GELF encoder was using newline delimited but graylog expected it to be '\0' delimited (https://go2docs.graylog.org/5-0/getting_in_log_data/gelf.html)

Reviewing the code, it seems that the GELF decoder is still using the newline delimiter as default in TCP inputs

.unwrap_or_else(|| decoding.default_stream_framing()),

| DeserializerConfig::Gelf(_)

Should this be changed to match the encoder's default and read streaming gelf with the '\0' delimiter?

Configuration

No response

Version

0.40.0

Debug Output

No response

Example Data

No response

Additional Context

No response

References

#18008

@jorgehermo9 jorgehermo9 added the type: bug A code related bug. label Jul 2, 2024
@jszwedko
Copy link
Member

jszwedko commented Jul 2, 2024

Thanks for filing this @jorgehermo9 . I tend to agree: the encoder and decoder should by symmetric. A concern I have is that GELF clients may be delimiting with newlines because that is what the spec calls for, but they can always override it. We'd welcome a PR fif you are up for it.

@jszwedko
Copy link
Member

jszwedko commented Jul 2, 2024

Actually, I stand corrected, the spec, as you linked to, does call for \0 delimited lines. Then yes, it seems like the decoder should definitely be using that by default.

@jszwedko jszwedko added the domain: codecs Anything related to Vector's codecs (encoding/decoding) label Jul 2, 2024
@jorgehermo9
Copy link
Author

jorgehermo9 commented Jul 2, 2024

Thank you very much for your prompt response. I'm familiar with that code as I've been implementing #20769, and it is a very simple change. I'm pleased to submit a PR addressing this soon.

@jorgehermo9 jorgehermo9 changed the title GELF decoder's with TCP Input default does not match the encoder's default GELF decoder's default fra kwith TCP Input does not match the encoder's default Jul 2, 2024
@jorgehermo9 jorgehermo9 changed the title GELF decoder's default fra kwith TCP Input does not match the encoder's default GELF decoder's default framer with TCP Input does not match the encoder's default Jul 2, 2024
@jorgehermo9 jorgehermo9 changed the title GELF decoder's default framer with TCP Input does not match the encoder's default GELF decoder's default framer with TCP input does not match the encoder's default Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: codecs Anything related to Vector's codecs (encoding/decoding) type: bug A code related bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants