-
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 cursor_seek_fallback option #9234
Add cursor_seek_fallback option #9234
Conversation
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.
@kvch golang code LGTM, can you add a documentation entry about that new setting in the [doc](https://github.com/elastic/beats/blob/master/journalbeat/docs/config-options.asciidoc?
CI is also failing on make check
@@ -2,7 +2,10 @@ | |||
journalbeat.inputs: | |||
- paths: [{{ journal_path }}] | |||
seek: {{ seek_method }} | |||
matches: [{{ matches }}] | |||
{% if seek_method == 'cursor' %} |
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.
For limiting surprises instead of checking for seek_method == "cursor"
it would be more flexible and explicit to use if cursor_seek_fallback
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 wrote if cursor_seek_fallback and seek_method == 'cursor'
to not to add that line when some other seek method is configured.
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.
What I meant by that is when you write your tests you want a direct relationship to what you define in the dictionary in python and what will be generated in the YAML config. When you use if cursor_seek_fallback and seek_method == 'cursor'
you make the assumption that I might have made a mistake by configuring seek_method
to another value than "cursor".
The problem by doing that is I won't know it without either looking at the YAML or in the output log.
# journalbeat can seek to the position defined in cursor_seek_fallback. | ||
"Seeking method set to cursor, but no state is saved for reader. Starting to read from the end", | ||
# message can be read from test journal | ||
"\"message\": \"thinkpad_acpi: please report the conditions when this event happened to ibm-acpi-devel@lists.sourceforge.net\"", |
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.
Where have you got the test message from :)
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.
Please add a changelog entry.
893a285
to
b87e37b
Compare
Failing tests are unrelated. |
New option is introduced to configure the fallback method of seek mode `"cursor"`. The option is named `cursor_seek_fallback`. The name is taken from the community Journalbeat: https://github.com/mheese/journalbeat/blob/master/config/journalbeat.yml#L3 By default it seeks to the beginning as before. But from now on it is possible to configure it to start reading from the end of the journal. (cherry picked from commit f3cbc0a)
New option is introduced to configure the fallback method of seek mode `"cursor"`. The option is named `cursor_seek_fallback`. The name is taken from the community Journalbeat: https://github.com/mheese/journalbeat/blob/master/config/journalbeat.yml#L3 By default it seeks to the beginning as before. But from now on it is possible to configure it to start reading from the end of the journal. (cherry picked from commit f3cbc0a)
New option is introduced to configure the fallback method of seek mode `"cursor"`. The option is named `cursor_seek_fallback`. The name is taken from the community Journalbeat: https://github.com/mheese/journalbeat/blob/master/config/journalbeat.yml#L3 By default it seeks to the beginning as before. But from now on it is possible to configure it to start reading from the end of the journal. (cherry picked from commit f3cbc0a)
New option is introduced to configure the fallback method of seek mode `"cursor"`. The option is named `cursor_seek_fallback`. The name is taken from the community Journalbeat: https://github.com/mheese/journalbeat/blob/master/config/journalbeat.yml#L3 By default it seeks to the beginning as before. But from now on it is possible to configure it to start reading from the end of the journal.
New option is introduced to configure the fallback method of seek mode `"cursor"`. The option is named `cursor_seek_fallback`. The name is taken from the community Journalbeat: https://github.com/mheese/journalbeat/blob/master/config/journalbeat.yml#L3 By default it seeks to the beginning as before. But from now on it is possible to configure it to start reading from the end of the journal. (cherry picked from commit f3cbc0a)
New option is introduced to configure the fallback method of seek mode
"cursor"
. The option is namedcursor_seek_fallback
. The name is taken from the community Journalbeat: https://github.com/mheese/journalbeat/blob/master/config/journalbeat.yml#L3By default it seeks to the beginning as before. But from now on it is possible to configure it to start reading from the end of the journal.