sumo
Version information
This version is compatible with:
- Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x
- Puppet >= 5.5.10 < 7.0.0
- Debian , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'pjorg-sumo', '1.4.2'
Learn more about managing modules with a PuppetfileDocumentation
pjorg-puppet-sumo
Table of Contents
Overview
This module installs and configures the Sumo Logic collector agent on a node, and also places source configuration under Puppet management. It also is designed to work with existing package managment rather than relying on downloading binaries directly from the Sumo Logic service and running the installer.
Module Description
The Sumo Logic collector is a small agent that is installed on hosts that facilitates the ingestion of log data into the Sumo Logic service.
There are a number of ways to install this agent. This module is intended for
use cases where native package management solutions are preferred over running
an installer. Initial support is limited to the RedHat
OS family, which uses
RPM packages.
Additionally, there is support for managing log sources within a node's manifest. This may be useful for ensuring that all nodes of a specific class always have certain log files collected.
Setup
What sumo affects
- Installs the SumoCollector package via
yum
- Creates the
sumo.conf
file to allow for initial collector setup - Creates a source sync directory and manages JSON files within it, which controls a collector's active log sources (this disables source management from within the Sumo Logic UI)
Beginning with sumo
Before starting, you must make the collector RPM available to your hosts' package
management. For RedHat-family operating systems, this means that
yum install SumoCollector
should work. If it does not, this module will not
function.
After that, a basic collector instance can be installed and configured by
including the sumo
class in a node's manifest, and passing credentials to
be used to attach the collector to your Sumo Logic account.
A basic example, using username/password and without any sources:
node mynode.lab.local {
class { 'sumo':
email => 'user@example.com',
password => 'usersPassword123!',
}
}
Second basic example, using username/password with single source json file:
node mynode.lab.local {
class { 'sumo':
email => 'user@example.com',
password => 'usersPassword123!',
syncsourceswithsinglejson => '/path/to/file.json',
}
}
A more advanced example, using a Sumo accessid and with a local file source:
node mynode.lab.local {
class { 'sumo':
accessid => 'SumoAccessId',
accesskey => 'SumoAccessKey_123ABC/&!',
}
sumo::localfilesource { 'messages':
sourcename => 'message_log'
pathexpression => '/var/log/messages',
}
}
Development
Contributions expanding the module to use other portions of the Sumo Logic API and/or extending support to other platforms are welcome.
Development targets the latest releases of Puppet versions 5 and 6. See
.travis.yml
for an exact matrix.
Reference
Table of Contents
Classes
sumo
: == Class: sumo This class initializes the module by calling subclasses that ensure the package is installed and the sumo.conf file exists.sumo::config
: sumo::config This class performs all configuration actions for the collector package.sumo::install
: sumo::install Performs package installation of the collector package. This class assumes the package is avaialble to the platform's native psumo::params
: sumo::params Default values for parameters used in the module.sumo::service
: sumo::service Controls the desired state of the collector service.
Defined types
sumo::conf
: sumo::conf This class manages the sumo.conf file, which the collector uses to perform initial setup.sumo::localfilesource
: sumo::localfilesource Creates a local file source for the collector to ingest from. This is done by creating a JSON file under the syncSourcsumo::remotefilesource
: sumo::remotefilesource Creates a remote file source for the collector to ingest from. This is done by creating a JSON file under the syncSousumo::syslogsource
: sumo::syslogsource Creates a syslog source for the collector to ingest from. This is done by creating a JSON file under the syncSources dire
Classes
sumo
== Class: sumo
This class initializes the module by calling subclasses that ensure the package is installed and the sumo.conf file exists.
=== Parameters
The parameters of this class mirror those that are used in the sumo.conf file. Additional information on what these parameters do can be found in the Sumo Logic documentation of the sumo.conf configuration file.
[accessid] Specify the accessid to use to authenticate to the Sumo Logic service. If you use this parameter, you must also pass an accesskey, and you must NOT pass email or password.
[accesskey] Specify the accesskey to use to authenticate to the Sumo Logic service. If you use this parameter, you must also pass an accessid, and you must NOT pass email or password.
[clobber] A boolean indicating whether to clobber the an existing collector with the same name.
[collectorname] The name of the collector. Defaults to the hostname.
[email] Specify the email address of the account to use to authenticate to the Sumo Logic service. If you use this parameter, you must also pass a password, and you must NOT pass accessid or accesskey.
[ephemeral] A boolean indicating whether the collector should be deleted automatically after being offline for 12 hours.
[purge_sumo_sources_d] Boolean indicating if /etc/sumo.sources.d should be managed. If true, it will enable purging so files not managed by Puppet will be removed. Default is false.
[override] A boolean indicating whether the collector should delete existing log sources amd use only what is described in the sources parameter.
[password] Specify the password of the account to use to authenticate to the Sumo Logic service. If you use this parameter, you must also pass an email, and you must NOT pass accessid or accesskey.
[proxyhost] The host name of a proxy to use to connect to Sumo Logic.
[proxyntlmdomain] When using an NTLM proxy, the domain of the user used to authenticate.
[proxypassword] The password to use when authenticating to a proxy.
[proxyport] The TCP port to connect to the proxy on.
[proxyuser] The username to use when authenticating to a proxy.
[sources] Path to JSON file that contains Source configuration.
[syncsources] The path to a JSON file or a directory containing JSON files with source configurations. This path is continually monitored for changes. By default, the module sets this to a directory and uses this directory to pass source configurations to the collector.
=== Examples
A basic example, using username/password and without any sources:
class sumo { email => 'user@example.com', password => 'usersPassword123!', }
A more advanced example, using a Sumo accessid and with a local file source:
class sumo { accessid => 'SumoAccessId', accesskey => 'SumoAccessKey_123ABC/&!', } sumo::localfilesource { 'messages': sourcename => 'message_log' pathexpression => '/var/log/messages', }
=== Authors
Peter D. Jorgensen pdjorgensen@gmail.com
=== Copyright
Copyright 2016 Peter D. Jorgensen, unless otherwise noted.
Parameters
The following parameters are available in the sumo
class.
accessid
Data type: Any
Default value: $::sumo::params::accessid
accesskey
Data type: Any
Default value: $::sumo::params::accesskey
clobber
Data type: Any
Default value: $::sumo::params::clobber
collectorname
Data type: Any
Default value: $::sumo::params::collectorname
email
Data type: Any
Default value: $::sumo::params::email
ephemeral
Data type: Any
Default value: $::sumo::params::ephemeral
purge_sumo_sources_d
Data type: Any
Default value: $::sumo::params::purge_sumo_sources_d
override
Data type: Any
Default value: $::sumo::params::override
password
Data type: Any
Default value: $::sumo::params::password
proxyhost
Data type: Any
Default value: $::sumo::params::proxyhost
proxyntlmdomain
Data type: Any
Default value: $::sumo::params::proxyntlmdomain
proxypassword
Data type: Any
Default value: $::sumo::params::proxypassword
proxyport
Data type: Any
Default value: $::sumo::params::proxyport
proxyuser
Data type: Any
Default value: $::sumo::params::proxyuser
sources
Data type: Any
Default value: $::sumo::params::sources
syncsources
Data type: Any
Default value: $::sumo::params::syncsources
syncsourceswithsinglejson
Data type: Any
Default value: $::sumo::params::syncsourceswithsinglejson
sumo::config
sumo::config
This class performs all configuration actions for the collector package.
sumo::install
sumo::install
Performs package installation of the collector package. This class assumes the package is avaialble to the platform's native package management tool.
sumo::params
sumo::params
Default values for parameters used in the module.
sumo::service
sumo::service
Controls the desired state of the collector service.
Defined types
sumo::conf
sumo::conf
This class manages the sumo.conf file, which the collector uses to perform initial setup.
Parameters
The following parameters are available in the sumo::conf
defined type.
accessid
Data type: Any
Default value: undef
accesskey
Data type: Any
Default value: undef
clobber
Data type: Any
Default value: undef
email
Data type: Any
Default value: undef
ephemeral
Data type: Any
Default value: undef
collectorname
Data type: Any
Default value: undef
override
Data type: Any
Default value: undef
password
Data type: Any
Default value: undef
proxyhost
Data type: Any
Default value: undef
proxyntlmdomain
Data type: Any
Default value: undef
proxypassword
Data type: Any
Default value: undef
proxyport
Data type: Any
Default value: undef
proxyuser
Data type: Any
Default value: undef
sources
Data type: Any
Default value: undef
syncsources
Data type: Any
Default value: undef
syncsourceswithsinglejson
Data type: Any
Default value: undef
sumo::localfilesource
sumo::localfilesource
Creates a local file source for the collector to ingest from. This is done by creating a JSON file under the syncSources directory that is configured in sumo.conf.
Parameters
The following parameters are available in the sumo::localfilesource
defined type.
pathexpression
Data type: Any
ensure
Data type: Any
Default value: present
sourcename
Data type: Any
Default value: $title
description
Data type: Any
Default value: undef
category
Data type: Any
Default value: undef
hostname
Data type: Any
Default value: undef
timezone
Data type: Any
Default value: undef
automaticdateparsing
Data type: Any
Default value: undef
multilineprocessingenabled
Data type: Any
Default value: undef
useautolinematching
Data type: Any
Default value: undef
manualprefixregexp
Data type: Any
Default value: undef
forcetimezone
Data type: Any
Default value: undef
defaultdateformat
Data type: Any
Default value: undef
filters
Data type: Any
Default value: undef
blacklist
Data type: Any
Default value: undef
encoding
Data type: Any
Default value: undef
sumo::remotefilesource
sumo::remotefilesource
Creates a remote file source for the collector to ingest from. This is done by creating a JSON file under the syncSources directory that is configured in sumo.conf.
Parameters
The following parameters are available in the sumo::remotefilesource
defined type.
remotepath
Data type: Any
remotehosts
Data type: Any
remoteport
Data type: Any
remoteuser
Data type: Any
authmethod
Data type: Any
ensure
Data type: Any
Default value: present
sourcename
Data type: Any
Default value: $title
description
Data type: Any
Default value: undef
category
Data type: Any
Default value: undef
hostname
Data type: Any
Default value: undef
timezone
Data type: Any
Default value: undef
automaticdateparsing
Data type: Any
Default value: undef
multilineprocessingenabled
Data type: Any
Default value: undef
useautolinematching
Data type: Any
Default value: undef
manualprefixregexp
Data type: Any
Default value: undef
forcetimezone
Data type: Any
Default value: undef
defaultdateformat
Data type: Any
Default value: undef
filters
Data type: Any
Default value: undef
blacklist
Data type: Any
Default value: undef
remotepassword
Data type: Any
Default value: undef
keypath
Data type: Any
Default value: undef
keypassword
Data type: Any
Default value: undef
sumo::syslogsource
sumo::syslogsource
Creates a syslog source for the collector to ingest from. This is done by creating a JSON file under the syncSources directory that is configured in sumo.conf.
Parameters
The following parameters are available in the sumo::syslogsource
defined type.
protocol
Data type: Any
port
Data type: Any
ensure
Data type: Any
Default value: present
sourcename
Data type: Any
Default value: $title
description
Data type: Any
Default value: undef
category
Data type: Any
Default value: undef
hostname
Data type: Any
Default value: undef
timezone
Data type: Any
Default value: undef
automaticdateparsing
Data type: Any
Default value: undef
multilineprocessingenabled
Data type: Any
Default value: undef
useautolinematching
Data type: Any
Default value: undef
manualprefixregexp
Data type: Any
Default value: undef
forcetimezone
Data type: Any
Default value: undef
defaultdateformat
Data type: Any
Default value: undef
filters
Data type: Any
Default value: undef
Dependencies
- puppetlabs/stdlib (>= 4.6.0 < 6.0.0)
The MIT License (MIT) Copyright (c) 2016 Peter D. Jorgensen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.