Ask Your Question

using elasticsearch-logstash puppet module

asked 2016-01-29 07:50:31 -0500

sayan gravatar image

updated 2016-01-31 04:49:33 -0500

I have a working puppet master/client setup on two vms. I need to use elasticsearch-logstash puppet module to ensure that the puppet client restarts logstash once a change is detected in logstash.conf file in puppet master.

I have added the following in the puppet master's site.pp and I am sure puppet agent is loading the module.

node 'puppetclient.localdomain' {   
    include logstash

I think I've to use restart_on_change => true setting but I'm not sure where. Is it in the init.pp file in logstash module? I have specified the input conf file location in logstash/manifests/configfile.pp which looks like

logstash::configfile { 'configname':
    content => template('path/to/config.file')

I'm using logstash as a service on ubuntu vm. Ideally the scenario should be, once I manually change the conf file on puppetmaster vm, the client should get notified and restart logstash. How do I achieve that? My logstash conf file looks like

input {
    stdin {}

filter {
    grok {
        match => { "message" => "%{COMMONAPACHELOG}" }

output {
   stdout { codec => rubydebug }
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-01-31 04:56:37 -0500

So, to your first question, restart_on_change defaults to true.

To your second question, by default the Puppet Agent will request a new catalog (which is a compiled manifest for that node) every 30 minutes. If you need it more immediately than every 30 minutes, you could change the wait time, you could look at using MCollective or Ansible to call the puppet run after a new version of your code is deployed, or you could look into masterless puppet, i.e. push the code directly to your logstash node, have no puppet master at all, and apply it using puppet apply.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-01-29 07:48:51 -0500

Seen: 107 times

Last updated: Jan 31 '16