Version information
This version is compatible with:
- , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'pcfens-filebeat', '0.3.1'Learn more about managing modules with a PuppetfileDocumentation
puppet-filebeat
Table of Contents
- Description
- Setup - The basics of getting started with filebeat
- Usage - Configuration options and additional functionality
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Description
The filebeat module installs and configures the filebeat log shipper maintained by elastic.
Setup
What filebeat affects
By default filebeat adds a software repository to your system, and installs filebeat along
with required configurations.
Setup Requirements
The filebeat module depends on puppetlabs/stdlib, and on
puppetlabs/apt on Debian based systems.
Beginning with filebeat
filebeat can be installed with puppet module install pcfens-filebeat (or with r10k, librarian-puppet, etc.)
The only required parameter, other than which files to ship, is the outputs parameter.
Usage
All of the default values in filebeat follow the upstream defaults (at the time of writing).
To ship files to elasticsearch:
class { 'filebeat':
outputs => {
'elasticsearch' => {
'hosts' => [
'http://localhost:9200',
'http://anotherserver:9200'
],
'index' => 'packetbeat',
'cas' => [
'/etc/pki/root/ca.pem',
],
},
},
}
To ship log files through logstash:
class { 'filebeat':
outputs => {
'logstash' => {
'hosts' => [
'localhost:5044',
'anotherserver:5044'
],
'loadbalance' => true,
},
},
}
Shipper and logging options can be configured the same way, and are documented on the elastic website.
Adding a prospector
Prospectors are processes that ship log files to elasticsearch or logstash. They can be defined as a hash added to the class declaration (also used for automatically creating prospectors using hiera), or as their own defined resources.
At a minimum, the paths parameter must be set to an array of files or blobs that should
be shipped. log_type is what logstash views as the type parameter if you'd like to
apply conditional filters.
filebeat::prospector { 'syslogs':
paths => [
'/var/log/auth.log',
'/var/log/syslog',
],
log_type => 'syslog-beat',
}
Limitations
This module doesn't load the elasticsearch index template into elasticsearch (required when shipping directly to elasticsearch).
Only filebeat versions after 1.0.0-rc1 are supported. 1.0.0-rc1 and older don't support YAML like the ruby template can easily generate.
Development
Pull requests and bug reports are welcome. If you're sending a pull request, please consider writing tests if applicable.
Dependencies
- puppetlabs/stdlib (>=4.6.0 <5.0.0)
- puppetlabs/apt (>=2.0.0 <3.0.0)