Skip to content
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

Merged
merged 2 commits into from
Nov 28, 2018

Conversation

kvch
Copy link
Contributor

@kvch kvch commented Nov 26, 2018

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.

@kvch kvch added review needs_backport PR is waiting to be backported to other branches. Journalbeat labels Nov 26, 2018
@kvch kvch requested review from ph and urso November 26, 2018 15:01
Copy link
Contributor

@ph ph left a 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' %}
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

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\"",
Copy link

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 :)

Copy link

@urso urso left a 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.

@kvch kvch force-pushed the feature-journalbeat-cursor-fallback-option branch from 893a285 to b87e37b Compare November 27, 2018 11:07
@kvch kvch changed the title Add cursor_seek_fallback option to journalbeat Add cursor_seek_fallback option Nov 27, 2018
@kvch kvch mentioned this pull request Nov 27, 2018
23 tasks
@kvch
Copy link
Contributor Author

kvch commented Nov 28, 2018

Failing tests are unrelated.

@kvch kvch merged commit f3cbc0a into elastic:master Nov 28, 2018
kvch added a commit to kvch/beats that referenced this pull request Nov 28, 2018
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)
@kvch kvch added v6.6.0 and removed needs_backport PR is waiting to be backported to other branches. labels Nov 28, 2018
kvch added a commit to kvch/beats that referenced this pull request Nov 28, 2018
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)
kvch added a commit that referenced this pull request Nov 29, 2018
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)
DStape pushed a commit to DStape/beats that referenced this pull request Aug 20, 2019
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.
DStape pushed a commit to DStape/beats that referenced this pull request Aug 20, 2019
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants