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 close and clean harvesting #70

Merged
merged 6 commits into from
Jan 5, 2017
Merged

Add close and clean harvesting #70

merged 6 commits into from
Jan 5, 2017

Conversation

narcisbcn
Copy link
Contributor

This PR allow us to close and clean harvesting parameters within the prospectors. This feature is for filebeat 5.
By defult I kept the filebeat values.


# When enabling this option, a file handler is closed immediately in case a file can't be found
# any more. In case the file shows up again later, harvesting will continue at the last known position
# after scan_frequency.
#close_removed: true
<%- if @close_removed -%>
close_removed: <%= @close_removed %>
Copy link
Owner

Choose a reason for hiding this comment

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

If close_removed is false then this will be excluded, defaulting to true.


# Removes the state for file which cannot be found on disk anymore immediately
#clean_removed: true
<%- if @clean_removed -%>
clean_removed: <%= @clean_removed %>
Copy link
Owner

Choose a reason for hiding this comment

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

The logic for setting this will work the same way that close_removed works, so we should probably improve that a bit here.

@narcisbcn
Copy link
Contributor Author

@pcfens: you were right. Now we are validating that some of those vars are booleans and adding the value into the template without conditional. Moreover puppet will print a notify if the prospector configuration does not make sense (IMHO it makes more sense a notify than a fail because is not puppet who has to stop the execution, I think filebeat is who has to do that). Thoughts?


$prospector_template = $filebeat::real_version ? {
'1' => 'prospector1.yml.erb',
default => 'prospector5.yml.erb',
}

if $close_removed == false and $clean_removed == true {
notify('If you set close_removed to false, does not make sense to set clean_removed to true. Review the official Filebeat documentation')
Copy link
Owner

Choose a reason for hiding this comment

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

I'm not sure how much commentary to add about configuration issues - there are a number of conflicting configuration parameters that can be set (e.g. ignore_older has to be greater than close_inactive).

Checking and warning for every conflict would be difficult to maintain, so I'm inclined to leave them out entirely.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair enough. Let's skip these kind of conflicts

@pcfens pcfens merged commit abf7f99 into pcfens:master Jan 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants