logstash
: This class manages installation, configuration and execution of Logstash 5.x.logstash::config
: This class manages configuration directories for Logstash.logstash::package
: This class manages the Logstash package. It is usually used only by the top-levellogstash
class. It's unlikely that you will need to decllogstash::service
: This mangages the system service for Logstash. It is usually used only by the top-levellogstash
class. It's unlikely that you will need t
logstash::configfile
: This type represents a Logstash pipeline configuration file. Parameters are mutually exclusive. Only one should be specified.logstash::patternfile
: This type represents a Grok pattern file for Logstash.logstash::plugin
: Manage the installation of a Logstash plugin. By default, plugins are downloaded from RubyGems, but it is also possible to install from a lo
This class manages installation, configuration and execution of Logstash 5.x.
class { 'logstash': }
class { 'logstash':
ensure => 'absent',
}
class { 'logstash':
status => 'disabled',
}
class { 'logstash':
settings => {
'http.port' => '9700',
}
}
class { 'logstash':
startup_options => {
'LS_USER' => 'root',
}
}
class { 'logstash':
jvm_options => [
'-Xms1g',
'-Xmx1g',
]
}
class { 'logstash':
pipelines => [
{
"pipeline.id" => "my-pipeline_1",
"path.config" => "/etc/path/to/p1.config",
},
{
"pipeline.id" => "my-other-pipeline",
"path.config" => "/etc/different/path/p2.cfg",
}
]
}
The following parameters are available in the logstash
class:
ensure
auto_upgrade
status
version
restart_on_change
package_url
package_name
download_timeout
home_dir
logstash_user
logstash_group
purge_config
service_provider
settings
startup_options
jvm_options_defaults
jvm_options
pipelines
manage_repo
config_dir
Data type: String
Controls if Logstash should be present
or absent
.
If set to absent
, the Logstash package will be
uninstalled. Related files will be purged as much as possible. The
exact behavior is dependant on the service provider, specifically its
support for the 'purgable' property.
Default value: 'present'
Data type: Boolean
If set to true
, Logstash will be upgraded if the package provider is
able to find a newer version. The exact behavior is dependant on the
service provider, specifically its support for the 'upgradeable' property.
Default value: false
Data type: String
The desired state of the Logstash service. Possible values:
enabled
: Service running and started at boot time.disabled
: Service stopped and not started at boot time.running
: Service running but not be started at boot time.unmanaged
: Service will not be started at boot time. Puppet will neither stop nor start the service.
Default value: 'enabled'
Data type: String
The specific version to install, if desired.
Default value: undef
Data type: Boolean
Restart the service whenever the configuration changes.
Disabling automatic restarts on config changes may be desired in an environment where you need to ensure restarts occur in a controlled/rolling manner rather than during a Puppet run.
Default value: true
Data type: String
Explict Logstash package URL to download.
Valid URL types are:
http://
https://
ftp://
puppet://
file:/
Default value: undef
Data type: String
The name of the Logstash package in the package manager.
Default value: 'logstash'
Data type: Integer
Timeout, in seconds, for http, https, and ftp downloads.
Default value: 600
Data type: Stdlib::Absolutepath
The home directory for logstash.
Default value: '/usr/share/logstash'
Data type: String
The user that Logstash should run as. This also controls file ownership.
Default value: 'logstash'
Data type: String
The group that Logstash should run as. This also controls file group ownership.
Default value: 'logstash'
Data type: Boolean
Purge the config directory of any unmanaged files,
Default value: true
Data type: String
Service provider (init system) to use. By Default, the module will try to choose the 'standard' provider for the current distribution.
Default value: undef
Data type: Hash
A collection of settings to be defined in logstash.yml
.
See: https://www.elastic.co/guide/en/logstash/current/logstash-settings-file.html
Default value: {}
Data type: Hash
A collection of settings to be defined in startup.options
.
See: https://www.elastic.co/guide/en/logstash/current/config-setting-files.html
Default value: {}
Data type: Hash
Default set of optionname => option mappings from upstream 8.5 version
Default value:
{
'-Xms' => '-Xms1g',
'-Xmx' => '-Xmx1g',
'UseConcMarkSweepGC' => '11-13:-XX:+UseConcMarkSweepGC',
'CMSInitiatingOccupancyFraction=' => '11-13:-XX:CMSInitiatingOccupancyFraction=75',
'UseCMSInitiatingOccupancyOnly' => '11-13:-XX:+UseCMSInitiatingOccupancyOnly',
'-Djava.awt.headless=' => '-Djava.awt.headless=true',
'-Dfile.encoding=' => '-Dfile.encoding=UTF-8',
'HeapDumpOnOutOfMemoryError' => '-XX:+HeapDumpOnOutOfMemoryError',
'-Djava.security.egd' => '-Djava.security.egd=file:/dev/urandom',
}
Data type: Array
A collection of settings to be defined in jvm.options
. Override same settings in jvm_options_defaults
Default value: []
Data type: Array
A collection of settings to be defined in pipelines.yml
.
Default value: []
Data type: Boolean
Enable repository management. Configure the official repositories.
Default value: true
Data type: String
Path containing the Logstash configuration.
Default value: '/etc/logstash'
This class manages configuration directories for Logstash.
include logstash::config
This class manages the Logstash package.
It is usually used only by the top-level logstash
class. It's unlikely
that you will need to declare this class yourself.
include logstash::package
The following parameters are available in the logstash::package
class:
Data type: String
The name of the Logstash package in the package manager.
Default value: $logstash::package_name
Data type: String
Install precisely this version from the package manager.
Default value: $logstash::version
Data type: String
Get the package from this URL, not from the package manager.
Default value: $logstash::package_url
This mangages the system service for Logstash.
It is usually used only by the top-level logstash
class. It's unlikely
that you will need to declare this class yourself.
include logstash::service
This type represents a Logstash pipeline configuration file.
Parameters are mutually exclusive. Only one should be specified.
logstash::configfile { 'heartbeat':
content => 'input { heartbeat {} }',
}
logstash::configfile { 'from-template':
template => 'site-logstash-module/pipeline-config.erb',
}
logstash::configfile { 'apache':
source => 'puppet://path/to/apache.conf',
}
logstash::configfile { 'heartbeat-2':
content => 'input { heartbeat {} }',
path => '/usr/local/etc/logstash/pipeline-2/heartbeat.conf'
}
The following parameters are available in the logstash::configfile
defined type:
Data type: String
Literal content to be placed in the file.
Default value: undef
Data type: String
A template from which to render the file.
Default value: undef
Data type: String
A file resource to be used for the file.
Default value: undef
Data type: String
An optional full path at which to create the file.
Default value: undef
This type represents a Grok pattern file for Logstash.
logstash::patternfile { 'mypattern':
source => 'puppet:///path/to/my/custom/pattern'
}
logstash::patternfile { 'mypattern':
source => 'puppet:///path/to/my/custom/pattern',
filename => 'custom-pattern-name'
}
The following parameters are available in the logstash::patternfile
defined type:
Data type: Pattern[/^(puppet|file):\/\//]
File source for the pattern file. eg. puppet://[...]
or file://[...]
Default value: undef
Data type: Optional[String[1]]
Optionally set the destination filename.
Default value: undef
Manage the installation of a Logstash plugin.
By default, plugins are downloaded from RubyGems, but it is also possible to install from a local Gem, or one stored in Puppet.
logstash::plugin { 'logstash-input-stdin': }
logstash::plugin { 'logstash-input-stout':
ensure => absent,
}
logstash::plugin { 'logstash-input-custom':
source => 'file:///tmp/logstash-input-custom.gem',
}
logstash::plugin { 'logstash-input-custom':
source => 'puppet:///modules/logstash-site-plugins/logstash-input-custom.gem',
}
logstash::plugin { 'x-pack':
source => 'https://artifacts.elastic.co/downloads/packs/x-pack/x-pack-5.3.0.zip',
}
logstash::plugin { 'logstash-input-jmx':
environment => ['LS_JAVA_OPTS=-Xms1g -Xmx1g']
}
The following parameters are available in the logstash::plugin
defined type:
Data type: String
Install or remove with present
or absent
.
Default value: present
Data type: String
Install from this file, not from RubyGems.
Default value: undef
Data type: String
User to install plugin as.
Default value: 'root'
Data type: String
Environment used when running 'logstash-plugin'
Default value: []