Puppet Class: datadog_agent::integrations::logs

Inherits:
datadog_agent::params
Defined in:
manifests/integrations/logs.pp

Overview

Class: datadog_agent::integrations::logs

This class will install the necessary configuration for the logs integration.

See the Datadog Logs Collection docs for all available configuration options docs.datadoghq.com/agent/logs/?tab=tailfiles#custom-log-collection

Parameters:

$logs:
    array of log sources.

Log Source:

$type
    Type of log input source (tcp / udp / file / docker / journald / windows_event).
$service
    Optional name of the service owning the log.
$source
    Optional attribute that defines which integration is sending the logs.
$tags
    Optional tags that are added to each log collected.
$log_processing_rules
    Optional array of processing rules.

Sample Usage:

class { 'datadog_agent::integrations::logs' :
  logs => [
    {
      'type' => 'file',
      'path' => '/var/log/afile.log',
    },
    {
      'type' => 'docker',
    },
  ],

}

Documentation: docs.datadoghq.com/logs/log_collection

Parameters:

  • logs (Array) (defaults to: [])


41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'manifests/integrations/logs.pp', line 41

class datadog_agent::integrations::logs (
  Array $logs = [],
) inherits datadog_agent::params {
  require datadog_agent

  file { "${datadog_agent::params::conf_dir}/logs.yaml":
    ensure  => file,
    owner   => $datadog_agent::dd_user,
    group   => $datadog_agent::params::dd_group,
    mode    => $datadog_agent::params::permissions_protected_file,
    content => template('datadog_agent/agent-conf.d/logs.yaml.erb'),
    require => Package[$datadog_agent::params::package_name],
    notify  => Service[$datadog_agent::params::service_name],
  }
}