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

Bugfix/#18277 add logrotate to logstash #59

Merged
merged 11 commits into from
Oct 31, 2024
8 changes: 8 additions & 0 deletions resources/recipes/prepare_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@
)
end

template '/etc/logrotate.d/logstash' do
source 'logstash_log-rotate.erb'
owner 'root'
group 'root'
mode 0644
retries 2
end

service 'chef-client' do
if node['redborder']['services']['chef-client']
action [:enable, :start]
Expand Down
16 changes: 16 additions & 0 deletions resources/templates/default/logstash_log-rotate.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
###############################################################################
# Generated by Chef #
###############################################################################

/var/log/logstash/*.log {
size=20M
missingok
rotate 5
compress
delaycompress
notifempty
copytruncate
postrotate
rm -f /var/log/logstash/*.gz > /dev/null
endscript
}
Loading