-
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
[Filebeat] offset points to end of line #6514
Comments
It seems we accidentially introduced this change in the 5.x releases. I tried 1.x where it's still as documented, but in 5.6 and 6.x it is as you reported. It probably happened because the offset in the registry needs to be at the end of the line and we move the calculation. I'm thinking having the offset reported as the beginning of the line feels more natural from a user perspective. But as so far nobody complained I wonder if it matters? |
I totally agree. I find having the offset point to the end of the line misleading. This came up while I was helper a user debug a json decoding issue, and we used the offset to determine where the line began in the log file and the offset became a point of confusion. Additionally, seeing |
The problem lies here: beats/filebeat/input/log/harvester.go Line 258 in bb6d3d8
In filebeat 1.x this happened after creating the event / fields data. Now it happens afterwards: beats/filebeat/input/log/harvester.go Line 272 in bb6d3d8
Even the code comments are incorrect :-( A fix should be pretty simple by temporarely copy the previous offset and then use it for the event creation. |
@ruflin So it sounds like a code (not doc) fix is required here? if so, maybe remove the doc label? |
@dedemorton Yes, removed. |
(cherry picked from commit df724c9)
…lastic#7345) (cherry picked from commit becec42)
The Filebeat documentation defines the
offset
field asBut it appears that the offset is actually pointing to the end of the line. For example, when reading the first line of the file you would expect
offset: 0
, but this is not the case (tested with 6.2.2).Should the docs or the code be changed?
The text was updated successfully, but these errors were encountered: