-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add Offset to libbeat/reader.Message
#39873
Add Offset to libbeat/reader.Message
#39873
Conversation
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
Offset contains the data read before the message itself
…rsonQ/beats into 39653-filestream-include-msg-parser
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
@AndersonQ could you please take care of the linter issues? |
CHANGELOG.next.asciidoc
Outdated
@@ -94,6 +94,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff] | |||
- Fix cache processor expiries infinite growth when large a large TTL is used and recurring keys are cached. {pull}38561[38561] | |||
- Fix parsing of RFC 3164 process IDs in syslog processor. {issue}38947[38947] {pull}38982[38982] | |||
- Rename the field "apache2.module.error" to "apache.module.error" in Apache error visualization. {issue}39480[39480] {pull}39481[39481] | |||
- Add the Offset property to libbeat/reader.Message to store the total number of bytes read and discarded before generating the message. This enables inputs to accurately determine how much data has been read up to the message, using Message.Bytes + Message.Offset. {pull}39873[39873] {issue}39653[39653] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need this in the user facing changelog, this is more of a developer only detail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Craig, the other item you wrote is enough.
- Add the Offset property to libbeat/reader.Message to store the total number of bytes read and discarded before generating the message. This enables inputs to accurately determine how much data has been read up to the message, using Message.Bytes + Message.Offset. {pull}39873[39873] {issue}39653[39653] |
} | ||
time.Sleep(10 * time.Millisecond) | ||
} | ||
fmt.Fprintf(msg, "unexpected number of events; expected: %d, actual: %d", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Fprintf(msg, "unexpected number of events; expected: %d, actual: %d", | |
fmt.Fprintf(msg, "unexpected number of events; expected: %d, actual: %d\n", |
CHANGELOG.next.asciidoc
Outdated
@@ -94,6 +94,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff] | |||
- Fix cache processor expiries infinite growth when large a large TTL is used and recurring keys are cached. {pull}38561[38561] | |||
- Fix parsing of RFC 3164 process IDs in syslog processor. {issue}38947[38947] {pull}38982[38982] | |||
- Rename the field "apache2.module.error" to "apache.module.error" in Apache error visualization. {issue}39480[39480] {pull}39481[39481] | |||
- Add the Offset property to libbeat/reader.Message to store the total number of bytes read and discarded before generating the message. This enables inputs to accurately determine how much data has been read up to the message, using Message.Bytes + Message.Offset. {pull}39873[39873] {issue}39653[39653] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Craig, the other item you wrote is enough.
- Add the Offset property to libbeat/reader.Message to store the total number of bytes read and discarded before generating the message. This enables inputs to accurately determine how much data has been read up to the message, using Message.Bytes + Message.Offset. {pull}39873[39873] {issue}39653[39653] |
This commit introduces the Offset property to libbeat/reader.Message, which stores the total number of bytes read and discarded before generating the message. The Offset field allows inputs to accurately determine how much data has been read up to the message, calculated as Message.Bytes + Message.Offset. With this new Offset field, the filestream input correctly updates its state to account for data read but discarded by the include_message parser. (cherry picked from commit 535a174) # Conflicts: # filebeat/input/filestream/environment_test.go
* libbeat: add Offset to libbeat/reader.Message (#39873) This commit introduces the Offset property to libbeat/reader.Message, which stores the total number of bytes read and discarded before generating the message. The Offset field allows inputs to accurately determine how much data has been read up to the message, calculated as Message.Bytes + Message.Offset. With this new Offset field, the filestream input correctly updates its state to account for data read but discarded by the include_message parser. (cherry picked from commit 535a174) # Conflicts: # filebeat/input/filestream/environment_test.go * Fixing conflicts --------- Co-authored-by: Anderson Queiroz <[email protected]> Co-authored-by: Pierre HILBERT <[email protected]>
Proposed commit message
libbeat: add Offset to libbeat/reader.Message
This commit introduces the Offset property to libbeat/reader.Message, which stores the total number of bytes read and discarded before generating the message. The Offset field allows inputs to accurately determine how much data has been read up to the message, calculated as Message.Bytes + Message.Offset.
With this new Offset field, the filestream input correctly updates its state to account for data read but discarded by the include_message parser.
Checklist
[ ] I have made corresponding changes to the documentation-~~ [ ] I have made corresponding change to the default configuration files~~
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Disruptive User Impact
None
How to test this PR locally
Follow the instructions on #39653
Related issues
include_message
do not correctly track the offset of a file #39653