Forge Home

vector

Installs and configures Vector

4,682 downloads

84 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 1.0.1 (latest)
  • 1.0.0
  • 0.1.4
  • 0.1.3
  • 0.1.2
  • 0.1.1
  • 0.1.0 (deleted)
released May 30th 2024
This version is compatible with:
  • Puppet Enterprise 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x
  • Puppet >= 6.21.0 < 8.0.0
  • , , , , ,

Start using this module

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

Add this module to your Puppetfile:

mod 'jhbigler-vector', '1.0.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add jhbigler-vector
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install jhbigler-vector --version 1.0.1

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

jhbigler/vector — version 1.0.1 May 30th 2024

vector

This puppet module installs, configures, and runs the Vector observability tool.

Description

The vector module installs, configures, and runs the Vector observability tool. This module is designed for Redhat and Fedora type systems, and also assumes it uses systemd for managing services.

Setup

Setup Requirements

This module requires puppet-stdlib.

Beginning with vector

This module will not configure yum or apt repositories, those should be configured outside of this module.

Usage

There are two ways to configure topologies:

  1. Using class parameters
    • These can be set with Hiera!
  2. Using defined types
    • Especially useful if your modules need to inject their own vector components
    • vector::source to configure a vector source
    • vector::transform to configure a vector transform
    • vector::sink to configure a vector sink
    • vector::configfile to configure a set of sources, transforms, and sinks

You can even use a mix of both of these strategies.

Examples

Using vector::configfile

require vector

vector::configfile { 'vector':
  data => {
    'sources' => {
        'logfiles' => {
            'type' => 'file',
            'include' => ['/var/log/**/*.log'],
        },
    },
    'sinks' => {
        'kafka' => {
            'type' => 'kafka',
            'inputs' => ['logfiles'],
            'bootstrap_servers' => 'localhost:9092',
            'encoding' => {
                'codec' => 'json',
            },
            'topic' => 'logs',
        },
    }
  },
}

Using vector::source, vector::transform, and vector::sink Note: 'type' is required for all of these defined types and 'inputs' is required for transform and sink types. Addition configuration parameters for these should be put in the 'parameters' hash.

require vector

vector::source { 'logfile_input':
    type       => 'file',
    parameters => {
        'include' => ['/var/log/**/*.log'],
    },
}

vector::transform { 'logfile_transform':
    type       => 'remap',
    inputs     => ['*'],
    parameters => {
        'source' => '.foo = "bar"',
    },
}

vector::sink { 'logfile_kafka':
    type       => 'kafka',
    inputs     => ['logfile_transform'],
    parameters => {
        'bootstrap_servers' => 'localhost:9092',
        'topic'             => 'logs',
        'encoding'          => {
            'codec' => 'json',
        },
    }
}

Using class parameters

class { 'vector':
  data_dir => '/data/vector',
  sources  => {
    'logfiles' => {
      'type'       => 'file',
      'parameters' => {
        'include'   => ['/var/log/**/*.log'],
        'read_from' => 'beginning',
      },
    },
    'syslogs'  => {
      'type'       => 'syslog',
      'parameters' => {
        'mode'    => 'tcp',
        'address' => '0.0.0.0:514',
      },
    },
  },
  sinks    => {
    'elasticsearch' => {
      'type'       => 'elasticsearch',
      'inputs'     => ['logfiles', 'syslogs'],
      'parameters' => {
        'endpoints' => 'elastic1:9200',
        'pipeline'  => 'logs',
      },
    },
  },
}

Using Hiera

vector::data_dir: '/data/vector'
vector::sources:
  logfiles:
    type: file
    parameters:
      include: ['/var/log/**/*.log']
      read_from: beginning
  syslogs:
    type: syslog
    parameters:
      mode: tcp
      address: '0.0.0.0:514'
vector::sinks:
  elasticsearch:
    type: elasticsearch
    inputs: ['logfiles','syslogs']
    parameters:
      endpoints: 'elastic1:9200'
      pipeline: logs

Reference

See REFERENCE.md