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

feat(input.tail): Add read_start config for controlling read behavior #16342

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wen-templari
Copy link

@wen-templari wen-templari commented Dec 22, 2024

Summary

Continue #16240

This PR add a read_start config for tail plugin. This option gives user more control over the read behavior.

  • It can take following options:

    • save-offset-or-end -- start reading from the persisted offset of the file or, if no offset persisted, start from the end (default)
    • save-offset-or-beginning -- start reading from the persisted offset of the file or, if no offset persisted, start from the beginning
    • end -- start reading from the end of the file ignoring any saved offset
    • beginning -- start reading from the beginning of the file ignoring any saved offset
  • Use save-offset-or-end as default because it matches the previous default from_beginning = false behavior.

  • After setting read_start, the from_beginning config will be ignored.

  • Change store offset logic. Now the plugin will always store offset ignoring the from_beginning config.

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #16237

@telegraf-tiger telegraf-tiger bot added area/tail feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tail feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[inputs.tail] Behaviour when from_beginning and statefile coexist is not as expected.
1 participant