GithubHelp home page GithubHelp logo

bwits / puppet-logstashforwarder Goto Github PK

View Code? Open in Web Editor NEW

This project forked from elastic/puppet-logstashforwarder

0.0 3.0 0.0 136 KB

Puppet module for Logstash Forwarder

License: Other

Ruby 40.14% Puppet 48.10% Shell 11.53% HTML 0.23%

puppet-logstashforwarder's Introduction

puppet-logstashforwarder

A puppet module for managing logstash-forwarder

Build Status

Requirements

  • Puppet 2.7.x or better.
  • The stdlib Puppet library.

Optional:

  • The apt Puppet library when using repo management on Debian/Ubuntu.

Usage

Installation, make sure service is running and will be started at boot time:

 class { 'logstashforwarder': }

Install a certain version:

 class { 'logstashforwarder':
   version => '1.0'
 }

In the absense of an appropriate package for your environment it is possible to install from other sources as well.

http/https/ftp source:

 class { 'logstashforwarder':
   package_url => 'http://download.website.com/packages/logstashforwarder.rpm'
 }

puppet:// source:

 class { 'logstashforwarder':
   package_url => 'puppet:///path/to/logstashforwarder.rpm'
 }

Local file source:

 class { 'logstashforwarder':
   package_url => 'file:/path/to/logstashforwarder.rpm'
 }

Attempt to upgrade logstashforwarder if a newer package is detected (false by default):

 class { 'logstashforwarder':
   autoupgrade => true
 }

Install everything but disable the service (useful for pre-configuring systems):

 class { 'logstashforwarder':
   status => 'disabled'
 }

Under normal circumstances a modification to the logstashforwarder configuration will trigger a restart of the service. This behaviour can be disabled:

 class { 'logstashforwarder':
   restart_on_change => false
 }

Disable and remove logstashforwarder entirely:

 class { 'logstashforwarder':
   ensure => 'absent'
 }     

Configuration

Network and SSL

For the network part of the configuration you need to set the servers and ssl information.

 class { 'logstashforwarder':
   servers  => [ 'logstash.yourdomain.com' ],
   ssl_key  => 'puppet:///path/to/your/ssl.key',
   ssl_ca   => 'puppet:///path/to/your/ssl.ca',
   ssl_cert => 'puppet:///path/to/your/ssl.cert'
 }

If you already manage the SSL files you can also specify them as the full path.

 class { 'logstashforwarder':
   servers  => [ 'logstash.yourdomain.com' ],
   ssl_key  => '/path/to/your/ssl.key',
   ssl_ca   => '/path/to/your/ssl.ca',
   ssl_cert => '/path/to/your/ssl.cert'
 }

Files

For configuring the files you want to process you can use the 'file' define:

 logstashforwarder::file { 'apache':
   paths  => [ '/var/log/apache/access.log' ],
   fields => { 'type' => 'apache' },
 }

The 'fields' hash allows you to set custom fields which you can use in Logstash.

Repository management

Most sites will manage repositories seperately; however, this module can manage the repository for you.

 class { 'logstashforwarder':
   manage_repo  => true
 }

Note: When using this on Debian/Ubuntu you will need to add the Puppetlabs/apt module to your modules.

Service Management

Currently only the basic SysV-style init service provider is supported but others could be implemented relatively easily (pull requests welcome).

init

Defaults File

The defaults file (/etc/defaults/logstashforwarder or /etc/sysconfig/logstashforwarder) for the logstashforwarder service can be populated as necessary. This can either be a static file resource or a simple key value-style hash object, the latter being particularly well-suited to pulling out of a data source such as Hiera.

file source
 class { 'logstashforwarder':
   init_defaults_file => 'puppet:///path/to/defaults'
 }
hash representation
 $config_hash = {
   'logstashforwarder_USER' => 'logstashforwarder',
   'logstashforwarder_GROUP' => 'logstashforwarder',
 }

 class { 'logstashforwarder':
   init_defaults => $config_hash
 }

Support

Need help? Join us in #logstash on Freenode IRC or on the https://discuss.elastic.co/c/logstash discussion forum.

puppet-logstashforwarder's People

Contributors

camelloj avatar electrical avatar jskarpe avatar ycombinator avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.