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

Move tail_files to prospector level #2932

Merged
merged 1 commit into from
Nov 7, 2016

Conversation

ruflin
Copy link
Member

@ruflin ruflin commented Nov 3, 2016

tail_files is now only applied on the first run and after that ignored. Also the state for all files falling under tail_files and not having a state, a state will directly be written.

  • Implement tail_files by setting ignore_older to 1ns for the first run
  • Fix typo in stats variable names

Closes #2613 and #2788

@urso
Copy link

urso commented Nov 3, 2016

This PR applies tail_files on every restart to every new file discovered since last run.

I'd rather see tail_files only being effective if no registry exists (or is empty on startup).

@ruflin ruflin force-pushed the tail_files-prospector branch from a01eb23 to 0417234 Compare November 3, 2016 14:41
tail_files is now only applied on the first run and after that ignored. Also the state for all files falling under tail_files and not having a state, a state will directly be written.

* Implement tail_files by setting ignore_older to 1ns for the first run
* Fix typo in stats variable names

Closes elastic#2613 and elastic#2788
@ruflin ruflin force-pushed the tail_files-prospector branch from 0417234 to fc63764 Compare November 3, 2016 14:44
@ruflin ruflin removed the blocked label Nov 3, 2016
// Disable tail_files after the first run
p.config.TailFiles = false
}()
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about:

if p.config.TailFiles {
  defer func(old time.Duration) {
    p.config.IgnoreOlder = old
  }(p.config.IgnoreOlder)

  p.config.TailFiles = false // disable tail_files in future calls
  p.config.IgnoreOlder = 1 * time.Nanosecond
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also work. The advantage of the first version is, that in case TailFiles is also used somewhere inside the first scan (which is not the case), it would still work.

@urso urso merged commit 71fd436 into elastic:master Nov 7, 2016
@ruflin ruflin deleted the tail_files-prospector branch November 7, 2016 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants