Forge Home

elastic_beats

Manage and install Elastic Beats with instances

1,459 downloads

1,459 latest version

5.0 quality score

Version information

  • 1.0.0 (latest)
released Nov 15th 2019
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, 2017.3.x, 2017.2.x, 2016.4.x
  • Puppet >= 4.10.0 < 7.0.0
  • , , , , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'mightp-elastic_beats', '1.0.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add mightp-elastic_beats
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install mightp-elastic_beats --version 1.0.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

mightp/elastic_beats — version 1.0.0 Nov 15th 2019

Overview

This module will install and configure Elastic Beats.

This module works on Debian- and RHEL-based OS'es, with systemd. \ Filebeat, Metricbeat and Auditbeat has been tested.

This module uses the idea of instances, meaning that one Beat will be created for each group of services. I.e to create two Filebeat instances, one monitoring system logs, and one monitoring InfluxDB logs, the configuration would be like so:

## INFLUXDB LOGS ##
::elastic_beats::instance { 'influxdb':
  beats                 => ['filebeat'],
  filebeat_output_url   => 'logstash.url:5001',
  kibana_url            => 'kibana.url:5601',
  ingest_pipeline_hosts => ['prod_elasticsearch.domain', 'test_elasticsearch.domain'],
  require               => Class['::elastic_beats'],
}

# Define a Input, and attach to above instance
::elastic_beats::input { 'filebeat_influxdb':
  beat          => 'filebeat',
  instance      => 'influxdb',
  configuration => [{
    'type'  => 'log',
    'paths' => ['/var/log/influxdb/influxd.log'],
  }],
}

## SYSTEM LOGS ##
::elastic_beats::instance { 'syslog':
  beats                 => ['filebeat'],
  filebeat_output_url   => 'logstash.url:5002',
  kibana_url            => 'kibana.url:5601',
  filebeat_modules      => ['system'], # Use the built-in system module for Filebeat
  ingest_pipeline_hosts => ['prod_elasticsearch.domain', 'test_elasticsearch.domain'],
  require               => Class['::elastic_beats'],
}

To use a Filebeat module, but with custom settings, one would do this:

::elastic_beats::instance { 'audit':
  auditbeat_output_url  => "logstash.url:5003",
  beats                 => ['auditbeat'],
  kibana_url            => "kibana.url:5601",
  ingest_pipeline_hosts => ['prod_elasticsearch.domain', 'test_elasticsearch.domain'],
  require               => Class['::elastic_beats'],
}

# Define a Module, and attach to above instance
::elastic_beats::module { 'auditbeat_system':
  beat          => 'auditbeat',
  instance      => 'audit',
  configuration => [{
    'module'                       => 'system',
    'enabled'                      => true,
    'period'                       => '1m',
    'user.detect_password_changes' => true,
    'login.btmp_file_pattern'      => '/var/log/btmp*',
    'login.wtmp_file_pattern'      => '/var/log/wtmp*',
    'state.period'                 => '12h',
    'datasets'                     => [
      'host',
      'login',
      'package',
      'process',
      'socket',
      'user',
    ],
  }],
}

::elastic_beats::module { 'auditbeat_auditd':
  beat          => 'auditbeat',
  instance      => 'audit',
  configuration => [{
    'module'           => 'auditd',
    'enabled'          => true,
    'backlog_limit'    => 32768,
    'failure_mode'     => 'log',
    'audit_rule_files' => '/etc/auditbeat/audit.rules.d/*.rules',
  }],
  require       => File['/etc/auditbeat/audit.rules.d/my_rules.rules'], # File type is not listed here, but needs to be defined
}