lusis / chef-logstash

Semi-official Logstash cookbook
Other
271 stars 353 forks source link

"agent" is not a valid parameter to Logstash anymore #488

Closed rafaelmagu closed 5 years ago

rafaelmagu commented 6 years ago

I've noticed an issue with Logstash 5.6.6 using the master branch of this cookbook where the service can't start because agent is an invalid parameter.

The problem stems from here: https://github.com/lusis/chef-logstash/blob/master/providers/service.rb#L210

As such, I had to fork this repo and remove that item from the array in order to get the service to start. Anyone else seeing this issue? Or is this cookbook deprecated in favour of another library one?

liorbachar commented 6 years ago

I had the same issue but I solved it in a different way. There is an attribute called templates_cookbook so you can pass it from your wrapper cookbook, https://github.com/lusis/chef-logstash/blob/master/providers/service.rb#L143 than, add 'tarball.erb' (default service file) under templates/init/systemd/ on your cookbook and do any change you need. Service file: https://github.com/lusis/chef-logstash/blob/master/templates/default/init/systemd/tarball.erb

Systemd unit modification I changed ExecStart command to drop the first element in args (which is hard-coded 'agent') ExecStart=<%= "#{@home}/bin/logstash #{@args.drop(1).join(' ')}" %>

Work like a charm 💯

rafaelmagu commented 6 years ago

That's a good workaround, @liorbachar! Thanks for sharing it! (I ended up needing another modification to make use of this cookbook, so ended up forking it.)