Defined Type: logstash::input::tcp

Defined in:
modules/logstash/manifests/input/tcp.pp

Overview

Define: logstash::input::tcp

Configure logstash to collect input via a tcp socket.

Parameters:

  • $ensure: Whether the config should exist. Default 'present'.

  • $port: Port to listen for udp2log input on. Default '5229'.

  • $codec: Codec to decode tcp stream input. Default 'plain'.

  • $priority: Configuration loading priority. Default '10'.

  • $ssl_enable: Enable/disable ssl support in logstash input. Default false.

  • $ssl_cert: Path to ssl certificate file. Requred when ssl is enabled.

  • $ssl_key: Path to ssl key file. Required when ssl is enabled.

  • $plugin_id: Name associated with Logstash metrics

Sample usage:

logstash::input::tcp {
    port  => 5229,
    codec => 'json_lines',
}

Parameters:

  • ensure (Wmflib::Ensure) (defaults to: present)
  • type (String) (defaults to: $title)
  • codec (String) (defaults to: 'plain')
  • port (Integer) (defaults to: 5229)
  • priority (Integer) (defaults to: 10)
  • ssl_enable (Boolean) (defaults to: false)
  • ssl_cert (Optional[String]) (defaults to: undef)
  • ssl_key (Optional[String]) (defaults to: undef)
  • plugin_id (String) (defaults to: "input/tcp/${port}")
  • tags (Optional[Array]) (defaults to: undef)


24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'modules/logstash/manifests/input/tcp.pp', line 24

define logstash::input::tcp(
    Wmflib::Ensure   $ensure     = present,
    String           $type       = $title,
    String           $codec      = 'plain',
    Integer          $port       = 5229,
    Integer          $priority   = 10,
    Boolean          $ssl_enable = false,
    Optional[String] $ssl_cert   = undef,
    Optional[String] $ssl_key    = undef,
    String           $plugin_id  = "input/tcp/${port}",
    Optional[Array]  $tags       = undef,
) {

    # Ensure cert/key params look like filesystem paths when ssl is enabled.
    if $ssl_enable == true {
      validate_absolute_path($ssl_cert)
      validate_absolute_path($ssl_key)
    }

    logstash::conf { "input-tcp-${title}":
        ensure   => $ensure,
        content  => template('logstash/input/tcp.erb'),
        priority => $priority,
    }
}