Skip to content

Commit

Permalink
Cherry-pick elastic#10541 to 6.x: Do not read last entry when falling…
Browse files Browse the repository at this point in the history
… back to tail (elastic#10554)

Previously, when falling back to tail seeking mode, the last entry was read by Journalbeat. This could lead to unwanted events being read, when a user simply wants to read new entries.
It was already fixed in case of tail seek mode.

This feature hasn't been released yet, so I am not adding a new changelog entry.
  • Loading branch information
kvch authored Feb 5, 2019
1 parent 8afef6e commit 20602d1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions reader/journal.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ func (r *Reader) seek(cursor string) {
r.logger.Debug("Seeking method set to cursor, but no state is saved for reader. Starting to read from the beginning")
case config.SeekTail:
r.journal.SeekTail()
r.journal.Next()
r.logger.Debug("Seeking method set to cursor, but no state is saved for reader. Starting to read from the end")
default:
r.logger.Error("Invalid option for cursor_seek_fallback")
Expand Down

0 comments on commit 20602d1

Please sign in to comment.