Version information
Start using this module
Add this module to your Puppetfile:
mod 'ispavailability-logstash', '0.3.4'
Learn more about managing modules with a PuppetfileDocumentation
puppet-logstash
A puppet module for managing and configuring Logstash
Versions
This overview shows you which puppet module and logstash version work together.
------------------------------------
| Puppet module | Logstash |
------------------------------------
| 0.0.1 - 0.1.0 | 1.1.9 |
------------------------------------
| 0.2.0 | 1.1.10 |
------------------------------------
| 0.3.0 - 0.3.4 | 1.1.12 - 1.1.13 |
------------------------------------
| in progress | 1.2.x |
------------------------------------
Version changes
From version 0.0.6 to 0.1.0 the following has been removed/changed:
initfile (string) => initfiles (hash)
defaultsfile (string) => defaultsfiles (hash)
Notes
With introduction of the multi-instance feature the default 'logstash' service gets disabled by the module when installed with a package. The module will create and manage the services based on the instance names, the old init script will remain on the system but will not be used.
Setting up logstash without configuration will cause logstash not to start. You will need to define atleast one plugin for Logstash to start.
For OS packages of logstash, see http://build.logstash.net/job/logstash-1.1.x/
Usage
Standard
Installation, make sure service is running and will be started at boot time:
class { 'logstash': }
Removal/decommissioning:
class { 'logstash':
ensure => 'absent',
}
Install everything but disable service(s) afterwards:
class { 'logstash':
status => 'disabled',
}
When you want to use an other service manager like 'runit' or 'daemontools':
class { 'logstash':
status => 'unmanaged'
}
Multi-instance
If you require running more then 1 instance on the same machine. If no instances are defined it will default to 'agent'.
class { 'logstash':
instances => [ 'instance1', 'instance2' ]
}
All plugins can be defined to a certain instance. For example:
logstash::input::file { 'fileinput':
instances => [ 'instance1' ]
}
logstash::input::file { 'fileinput2':
instances => [ 'instance2' ]
}
If you rather not use the multi-instance feature you can diable this:
class { 'logstash':
multi_instance => false
}
Other options
If you rather supply your own init script:
class { 'logstash':
initfiles => { 'agent' => 'puppet:///path/to/initfile' }
}
In all cases you can supply a defaults file:
class { 'logstash':
defaultsfiles => { 'agent' => 'puppet:///path/to/defaults' }
}
Installation with a JAR file:
class { 'logstash':
provider => 'custom',
jarfile => 'puppet:///path/to/jarfile',
installpath => '/path/to/install/dir'
}
When no init script is provided when using custom provider, built in init script will be placed. You can however supply your own init script and defaults file.
class { 'logstash':
provider => 'custom',
jarfile => 'puppet:///path/to/jarfile',
initfiles => { 'agent' => 'puppet:///path/to/initfile' },
defaultsfiles => { 'agent' => 'puppet:///path/to/defaultsfile' }
}
If you want java to be installed by the module:
class { 'logstash':
java_install => true
}
If you want a specific java package/version:
class { 'logstash':
java_install => true,
java_package => 'packagename'
}
If you want to define your own logstash config (multi-instance): class { 'logstash': conffile => { 'agent' => 'puppet:///data/logstash/agent.config' } }
If you want to define your own logstash config (single-instance): class { 'logstash': conffile => 'puppet:///data/logstash/agent.config' }
If you want to have the logstash files owned by an other user then 'root':
class { 'logstash':
logstash_user => 'logstash',
logstash_group => 'logstash'
}
Please note that this does not set the user in the init file!!
Plugins
Every plugin in Logstash has its own define file.
For more information check the puppet files in the input, output and filter directories.
Simple examples:
logstash::input::syslog { 'logstash-syslog':
type => 'syslog',
port => '5544',
}
logstash::output::redis { 'logstash-redis':
host => [$::fqdn],
data_type => 'list',
}
File transfers
From version 0.2.0 its now possible to automatically transfer files to the host for plugins that require a file.
For example lumberjack requires a certificate, so you can do the following:
logstash::input::lumberjack { 'lumberjack_input':
ssl_certificate => 'puppet:///path/to/ssl.cert':
}
the file 'ssl.cert' will be placed in a pre-defined place and set in the configuration.
0.3.4 ( Oct 14, 2013 ) Fixing purging of created directories ( PR #61, #64 by Kayla Green and Jason Koppe ) Documentation fixes ( PR #65, #67 by Kristian Glass and Andreas Paul ) Making config dir configurable ( PR #70 by Justin Lambert ) Permit HTTP(s) for downloading logstash ( PR #71 by Phil Fenstermacher ) Ensure user/group is passed in the debian init file Spec cleanup ( PR #75 by Justin Lambert ) set logstash logdir perms when using custom jar provider ( PR #74 by Justin Lambert ) clean up installpath when updating jars ( PR #72 by Justin Lambert ) fix wrong creates path at jar custom provider ( PR #83 by Daniel Werdermann ) added 'in progress' for logstash version 1.2.x ( PR #87 by rtoma ) Add small input/output examples ( PR #89 by Andreas Paul ) Solving defaults file not being installed in some cases http download of jar should require $jardir ( PR #90 by Max Griffiths ) add ability to install a logstash config file ( PR #93 by Justin Lambert )
0.3.3 ( Jun 15, 2013 ) Enable puppet 3.2.x testing Fix issue that the config dir was missing in the init files Fix variable access deprecation warning ( PR #56 by Richard Peng )
0.3.2 ( May 23, 2013 ) Fixing issue when using jar file without multi-instance feature Added rspec tests to cover this issue
0.3.1 ( May 15, 2013 ) Missed changes for enabling/disabling multi-instance feature Adding a few spec tests for the multi-instance feature
0.3.0 ( May 09, 2013 ) Update defines for Logstash 1.1.12 Adding license file Deleted old init file removal to avoid issues. ( Issue #50 ) Allow file owner/group to be variable ( Issue/PR #47 ) Ensure log directory exists before starting ( PR #53 by Brian Lalor ) Provide complete containment of the class ( PR #53 by Brian Lalor ) Update rspec tests for new defines
0.2.0 ( Apr 30, 2013 ) Update defines for logstash 1.1.10 New feature for plugins to automatically transfer files ( Issue #24 ) Create correct tmp dir ( Issue #35 ) Change file modes to be more secure ( Issue #36 ) Update defines for better input validation ( Issue #43 ) Adding rspec tests for plugin defines Fix tmp dir Debian init script ( PR #44 by Dan Carley )
0.1.0 ( Mar 25, 2013 ) Don't backup the Jar file or the symlink ( Issue #25 by Garth Kidd ) First implementation of the multi-instance feature. This will break certain functionality.
0.0.6 ( Mar 07, 2013 ) Fix issue that the init file was overwritten Ensure we install java first before starting logstash if enabled
0.0.5 ( Mar 02, 2013 ) Adding spec tests Update Readme ( PR #20 by rjw1 ) New feature to install java
0.0.4 ( Feb 10, 2013 ) Rename Redhat to RedHat for init file ( PR #12 by pkubat ) Adding Amazon as Operating system ( PR #12 by pkubat ) Symlinking Jar file to generic name ( PR #12 by pkubat ) Correting symlink ( PR #14 by Jeff Wong )
0.0.3 ( Feb 5, 2013 ) Clarify jarfile usage and validation ( PR #6 by Garth Kidd ) Add default Debian Init script when non provided and using custom source ( PR #7 by Garth Kidd ) Add RedHat as OS type ( PR #8 by Dan ) Skip init script when status = unmanaged ( PR #9 by Tavis Aitken ) Refactored the custom provider part ( With help of Garth Kidd )
0.0.2 ( Jan 19, 2013 ) Adding a way to provide jar and init file instead of depending on a package
0.0.1 ( Jan 13, 2013 ) Initial release of the module
Dependencies
- puppetlabs/stdlib (>= 3.0.0)
Copyright 2012-2013 Richard Pijnenburg Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.