-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Final newline character missing when using AWS S3 sink #21086
Labels
domain: codecs
Anything related to Vector's codecs (encoding/decoding)
type: bug
A code related bug.
Comments
jszwedko
added
the
domain: codecs
Anything related to Vector's codecs (encoding/decoding)
label
Aug 16, 2024
Good spot @miquelruiz I think vector/src/sinks/util/encoding.rs Lines 48 to 59 in f7e4470
encode is used, a , is appended to each element as it is encoded, but when encoding as a JSON array the trailing , isn't wanted which is why serialize is used instead.
I think a possible fix for this would be to update: vector/src/codecs/encoding/encoder.rs Lines 96 to 104 in f7e4470
To have it add a |
jszwedko
added a commit
that referenced
this issue
Aug 16, 2024
…in a newline Fixes: #21086 Signed-off-by: Jesse Szwedko <[email protected]>
Opened a PR: #21097 |
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.
A note for the community
Problem
When using the AWS S3 sink to upload local logs, the last line of each uploaded object is missing a newline character at the end. This is not the case when using the File sink.
It seems to be caused by the S3 sink calling
encoder.serialize
on the last event of the batch (https://github.com/vectordotdev/vector/blob/master/src/sinks/util/encoding.rs#L51) while the file sink callsencoder.encode
on all events (https://github.com/vectordotdev/vector/blob/master/src/sinks/file/mod.rs#L427).I would expect these to behave in the same way using the provided config.
Configuration
Version
vector 0.40.0 (aarch64-unknown-linux-gnu 1167aa9 2024-07-29 15:08:44.028365803)
Debug Output
No response
Example Data
No response
Additional Context
No response
References
No response
The text was updated successfully, but these errors were encountered: