diff --git a/manifests/config.pp b/manifests/config.pp index fa0d6714..dc937574 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -9,7 +9,7 @@ if has_key($filebeat::setup, 'ilm.policy') { file {"${filebeat::config_dir}/ilm_policy.json": content => to_json({'policy' => $filebeat::setup['ilm.policy']}), - notify => Service['filebeat'], + notify => Service["${service_name}"], require => File['filebeat-config-dir'], } $setup = $filebeat::setup - 'ilm.policy' + {'ilm.policy_file' => "${filebeat::config_dir}/ilm_policy.json"} @@ -17,216 +17,260 @@ $setup = $filebeat::setup } - if versioncmp($major_version, '6') >= 0 { - $filebeat_config_temp = delete_undef_values({ - 'shutdown_timeout' => $filebeat::shutdown_timeout, - 'name' => $filebeat::beat_name, - 'tags' => $filebeat::tags, - 'max_procs' => $filebeat::max_procs, - 'fields' => $filebeat::fields, - 'fields_under_root' => $filebeat::fields_under_root, - 'filebeat' => { - 'config.inputs' => { - 'enabled' => true, - 'path' => "${filebeat::config_dir}/*.yml", - }, - 'config.modules' => { - 'enabled' => $filebeat::enable_conf_modules, - 'path' => "${filebeat::modules_dir}/*.yml", - }, - 'shutdown_timeout' => $filebeat::shutdown_timeout, - 'modules' => $filebeat::modules, - }, - 'http' => $filebeat::http, - 'cloud' => $filebeat::cloud, - 'output' => $filebeat::outputs, - 'shipper' => $filebeat::shipper, - 'logging' => $filebeat::logging, - 'runoptions' => $filebeat::run_options, - 'processors' => $filebeat::processors, - 'monitoring' => $filebeat::monitoring, - 'setup' => $setup, - }) - # Add the 'xpack' section if supported (version >= 6.1.0) and not undef - if $filebeat::xpack and versioncmp($filebeat::package_ensure, '6.1.0') >= 0 { - $filebeat_config = deep_merge($filebeat_config_temp, {'xpack' => $filebeat::xpack}) - } - else { - $filebeat_config = $filebeat_config_temp - } - } else { - $filebeat_config_temp = delete_undef_values({ - 'shutdown_timeout' => $filebeat::shutdown_timeout, - 'name' => $filebeat::beat_name, - 'tags' => $filebeat::tags, - 'queue_size' => $filebeat::queue_size, - 'max_procs' => $filebeat::max_procs, - 'fields' => $filebeat::fields, - 'fields_under_root' => $filebeat::fields_under_root, - 'filebeat' => { - 'spool_size' => $filebeat::spool_size, - 'idle_timeout' => $filebeat::idle_timeout, - 'registry_file' => $filebeat::registry_file, - 'publish_async' => $filebeat::publish_async, - 'config_dir' => $filebeat::config_dir, - 'shutdown_timeout' => $filebeat::shutdown_timeout, - }, - 'output' => $filebeat::outputs, - 'shipper' => $filebeat::shipper, - 'logging' => $filebeat::logging, - 'runoptions' => $filebeat::run_options, - 'processors' => $filebeat::processors, - }) - # Add the 'modules' section if supported (version >= 5.2.0) - if versioncmp($filebeat::package_ensure, '5.2.0') >= 0 { - $filebeat_config = deep_merge($filebeat_config_temp, {'modules' => $filebeat::modules}) - } - else { - $filebeat_config = $filebeat_config_temp - } + if $filebeat::outputs.empty == true { + $outputs = { 'none' => undef } } - - if 'filebeat_version' in $facts and $facts['filebeat_version'] != false { - $skip_validation = versioncmp($facts['filebeat_version'], $filebeat::major_version) ? { - -1 => true, - default => false, - } - } else { - $skip_validation = false + else { + $outputs = $filebeat::outputs } - case $::kernel { - 'Linux' : { - $validate_cmd = ($filebeat::disable_config_test or $skip_validation) ? { - true => undef, - default => $major_version ? { - '5' => "${filebeat::filebeat_path} ${filebeat::extra_validate_options} -N -configtest -c %", - default => "${filebeat::filebeat_path} ${filebeat::extra_validate_options} -c % test config", - }, + $outputs.each |$output_name, $output_values| { + if 'type' in $output_values { + $output = { $output_values['type'] => delete($output_values, 'type') } + $config_file = regsubst($filebeat::config_file, '.yml', ".${output_name}.yml") + $service_output = $output_name + $service_name = "${filebeat::module_name}.${output_name}" + } + else { + if $output_name == 'none' { + $output = $filebeat::outputs } - - file {'filebeat.yml': - ensure => $filebeat::file_ensure, - path => $filebeat::config_file, - content => template($filebeat::conf_template), - owner => $filebeat::config_file_owner, - group => $filebeat::config_file_group, - mode => $filebeat::config_file_mode, - validate_cmd => $validate_cmd, - notify => Service['filebeat'], - require => File['filebeat-config-dir'], + else { + $output = { $output_name => $output_values } } - - file {'filebeat-config-dir': - ensure => $filebeat::directory_ensure, - path => $filebeat::config_dir, - owner => $filebeat::config_dir_owner, - group => $filebeat::config_dir_group, - mode => $filebeat::config_dir_mode, - recurse => $filebeat::purge_conf_dir, - purge => $filebeat::purge_conf_dir, - force => true, - notify => Service['filebeat'], + if keys($filebeat::outputs).length <= 1 { + $config_file = $filebeat::config_file + $service_output = $filebeat::module_name + $service_name = $filebeat::module_name } - } # end Linux - - 'FreeBSD' : { - $validate_cmd = ($filebeat::disable_config_test or $skip_validation) ? { - true => undef, - default => '/usr/local/sbin/filebeat ${filebeat::extra_validate_options} -N -configtest -c %', - } - - file {'filebeat.yml': - ensure => $filebeat::file_ensure, - path => $filebeat::config_file, - content => template($filebeat::conf_template), - owner => $filebeat::config_file_owner, - group => $filebeat::config_file_group, - mode => $filebeat::config_file_mode, - validate_cmd => $validate_cmd, - notify => Service['filebeat'], - require => File['filebeat-config-dir'], + else { + $config_file = regsubst($filebeat::config_file, '.yml', ".${output_name}.yml") + $service_name = $output_name + $service_name = "${filebeat::module_name}.${output_name}" } + } - file {'filebeat-config-dir': - ensure => $filebeat::directory_ensure, - path => $filebeat::config_dir, - owner => $filebeat::config_dir_owner, - group => $filebeat::config_dir_group, - mode => $filebeat::config_dir_mode, - recurse => $filebeat::purge_conf_dir, - purge => $filebeat::purge_conf_dir, - force => true, - notify => Service['filebeat'], - } - } # end FreeBSD + filebeat::service::add { "${service_output}": } - 'OpenBSD' : { - $validate_cmd = ($filebeat::disable_config_test or $skip_validation) ? { - true => undef, - default => $major_version ? { - '5' => "${filebeat::filebeat_path} ${filebeat::extra_validate_options} -N -configtest -c %", - default => "${filebeat::filebeat_path} ${filebeat::extra_validate_options} -c % test config", + if versioncmp($major_version, '6') >= 0 { + $filebeat_config_temp = delete_undef_values({ + 'shutdown_timeout' => $filebeat::shutdown_timeout, + 'name' => $filebeat::beat_name, + 'tags' => $filebeat::tags, + 'max_procs' => $filebeat::max_procs, + 'fields' => $filebeat::fields, + 'fields_under_root' => $filebeat::fields_under_root, + 'filebeat' => { + 'config.inputs' => { + 'enabled' => true, + 'path' => "${filebeat::config_dir}/*.yml", + }, + 'config.modules' => { + 'enabled' => $filebeat::enable_conf_modules, + 'path' => "${filebeat::modules_dir}/*.yml", + }, + 'shutdown_timeout' => $filebeat::shutdown_timeout, + 'modules' => $filebeat::modules, }, + 'http' => $filebeat::http, + 'cloud' => $filebeat::cloud, + 'output' => $output, + 'shipper' => $filebeat::shipper, + 'logging' => $filebeat::logging, + 'runoptions' => $filebeat::run_options, + 'processors' => $filebeat::processors, + 'monitoring' => $filebeat::monitoring, + 'setup' => $setup, + }) + # Add the 'xpack' section if supported (version >= 6.1.0) and not undef + if $filebeat::xpack and versioncmp($filebeat::package_ensure, '6.1.0') >= 0 { + $filebeat_config = deep_merge($filebeat_config_temp, {'xpack' => $filebeat::xpack}) } - - file {'filebeat.yml': - ensure => $filebeat::file_ensure, - path => $filebeat::config_file, - content => template($filebeat::conf_template), - owner => $filebeat::config_file_owner, - group => $filebeat::config_file_group, - mode => $filebeat::config_file_mode, - validate_cmd => $validate_cmd, - notify => Service['filebeat'], - require => File['filebeat-config-dir'], + else { + $filebeat_config = $filebeat_config_temp } - - file {'filebeat-config-dir': - ensure => $filebeat::directory_ensure, - path => $filebeat::config_dir, - owner => $filebeat::config_dir_owner, - group => $filebeat::config_dir_group, - mode => $filebeat::config_dir_mode, - recurse => $filebeat::purge_conf_dir, - purge => $filebeat::purge_conf_dir, - force => true, - notify => Service['filebeat'], + } else { + $filebeat_config_temp = delete_undef_values({ + 'shutdown_timeout' => $filebeat::shutdown_timeout, + 'name' => $filebeat::beat_name, + 'tags' => $filebeat::tags, + 'queue_size' => $filebeat::queue_size, + 'max_procs' => $filebeat::max_procs, + 'fields' => $filebeat::fields, + 'fields_under_root' => $filebeat::fields_under_root, + 'filebeat' => { + 'spool_size' => $filebeat::spool_size, + 'idle_timeout' => $filebeat::idle_timeout, + 'registry_file' => $filebeat::registry_file, + 'publish_async' => $filebeat::publish_async, + 'config_dir' => $filebeat::config_dir, + 'shutdown_timeout' => $filebeat::shutdown_timeout, + }, + 'output' => $output, + 'shipper' => $filebeat::shipper, + 'logging' => $filebeat::logging, + 'runoptions' => $filebeat::run_options, + 'processors' => $filebeat::processors, + }) + # Add the 'modules' section if supported (version >= 5.2.0) + if versioncmp($filebeat::package_ensure, '5.2.0') >= 0 { + $filebeat_config = deep_merge($filebeat_config_temp, {'modules' => $filebeat::modules}) } - } # end OpenBSD - - 'Windows' : { - $cmd_install_dir = regsubst($filebeat::install_dir, '/', '\\', 'G') - $filebeat_path = join([$cmd_install_dir, 'Filebeat', 'filebeat.exe'], '\\') - - $validate_cmd = ($filebeat::disable_config_test or $skip_validation) ? { - true => undef, - default => $major_version ? { - '7' => "\"${filebeat_path}\" ${filebeat::extra_validate_options} test config -c \"%\"", - default => "\"${filebeat_path}\" ${filebeat::extra_validate_options} -N -configtest -c \"%\"", - } + else { + $filebeat_config = $filebeat_config_temp } + } - file {'filebeat.yml': - ensure => $filebeat::file_ensure, - path => $filebeat::config_file, - content => template($filebeat::conf_template), - validate_cmd => $validate_cmd, - notify => Service['filebeat'], - require => File['filebeat-config-dir'], + if 'filebeat_version' in $facts and $facts['filebeat_version'] != false { + $skip_validation = versioncmp($facts['filebeat_version'], $filebeat::major_version) ? { + -1 => true, + default => false, } + } else { + $skip_validation = false + } + + case $::kernel { + 'Linux' : { + $validate_cmd = ($filebeat::disable_config_test or $skip_validation) ? { + true => undef, + default => $major_version ? { + '5' => "${filebeat::filebeat_path} ${filebeat::extra_validate_options} -N -configtest -c %", + default => "${filebeat::filebeat_path} ${filebeat::extra_validate_options} -c % test config", + }, + } + + file {"$config_file": + ensure => $filebeat::file_ensure, + path => $config_file, + content => template($filebeat::conf_template), + owner => $filebeat::config_file_owner, + group => $filebeat::config_file_group, + mode => $filebeat::config_file_mode, + validate_cmd => $validate_cmd, + notify => Service["${service_name}"], + require => File['filebeat-config-dir'], + } - file {'filebeat-config-dir': - ensure => $filebeat::directory_ensure, - path => $filebeat::config_dir, - recurse => $filebeat::purge_conf_dir, - purge => $filebeat::purge_conf_dir, - force => true, + if !defined(File['filebeat-config-dir']) { + file {'filebeat-config-dir': + ensure => $filebeat::directory_ensure, + path => $filebeat::config_dir, + owner => $filebeat::config_dir_owner, + group => $filebeat::config_dir_group, + mode => $filebeat::config_dir_mode, + recurse => $filebeat::purge_conf_dir, + purge => $filebeat::purge_conf_dir, + force => true, + notify => Service["${service_name}"], + } + } + } # end Linux + + 'FreeBSD' : { + $validate_cmd = ($filebeat::disable_config_test or $skip_validation) ? { + true => undef, + default => '/usr/local/sbin/filebeat ${filebeat::extra_validate_options} -N -configtest -c %', + } + + file {'filebeat.yml': + ensure => $filebeat::file_ensure, + path => $filebeat::config_file, + content => template($filebeat::conf_template), + owner => $filebeat::config_file_owner, + group => $filebeat::config_file_group, + mode => $filebeat::config_file_mode, + validate_cmd => $validate_cmd, + notify => Service["${service_name}"], + require => File['filebeat-config-dir'], + } + + if !defined(File['filebeat-config-dir']) { + file {'filebeat-config-dir': + ensure => $filebeat::directory_ensure, + path => $filebeat::config_dir, + owner => $filebeat::config_dir_owner, + group => $filebeat::config_dir_group, + mode => $filebeat::config_dir_mode, + recurse => $filebeat::purge_conf_dir, + purge => $filebeat::purge_conf_dir, + force => true, + notify => Service["${service_name}"], + } + } + } # end FreeBSD + + 'OpenBSD' : { + $validate_cmd = ($filebeat::disable_config_test or $skip_validation) ? { + true => undef, + default => $major_version ? { + '5' => "${filebeat::filebeat_path} ${filebeat::extra_validate_options} -N -configtest -c %", + default => "${filebeat::filebeat_path} ${filebeat::extra_validate_options} -c % test config", + }, + } + + file {'filebeat.yml': + ensure => $filebeat::file_ensure, + path => $filebeat::config_file, + content => template($filebeat::conf_template), + owner => $filebeat::config_file_owner, + group => $filebeat::config_file_group, + mode => $filebeat::config_file_mode, + validate_cmd => $validate_cmd, + notify => Service["${service_name}"], + require => File['filebeat-config-dir'], + } + + if !defined(File['filebeat-config-dir']) { + file {'filebeat-config-dir': + ensure => $filebeat::directory_ensure, + path => $filebeat::config_dir, + owner => $filebeat::config_dir_owner, + group => $filebeat::config_dir_group, + mode => $filebeat::config_dir_mode, + recurse => $filebeat::purge_conf_dir, + purge => $filebeat::purge_conf_dir, + force => true, + notify => Service["${service_name}"], + } + } + } # end OpenBSD + + 'Windows' : { + $cmd_install_dir = regsubst($filebeat::install_dir, '/', '\\', 'G') + $filebeat_path = join([$cmd_install_dir, 'Filebeat', 'filebeat.exe'], '\\') + + $validate_cmd = ($filebeat::disable_config_test or $skip_validation) ? { + true => undef, + default => $major_version ? { + '7' => "\"${filebeat_path}\" ${filebeat::extra_validate_options} test config -c \"%\"", + default => "\"${filebeat_path}\" ${filebeat::extra_validate_options} -N -configtest -c \"%\"", + } + } + + file {'filebeat.yml': + ensure => $filebeat::file_ensure, + path => $filebeat::config_file, + content => template($filebeat::conf_template), + validate_cmd => $validate_cmd, + notify => Service["${service_name}"], + require => File['filebeat-config-dir'], + } + + if !defined(File['filebeat-config-dir']) { + file {'filebeat-config-dir': + ensure => $filebeat::directory_ensure, + path => $filebeat::config_dir, + recurse => $filebeat::purge_conf_dir, + purge => $filebeat::purge_conf_dir, + force => true, + } + } + } # end Windows + + default : { + fail($filebeat::kernel_fail_message) } - } # end Windows - - default : { - fail($filebeat::kernel_fail_message) } } } diff --git a/manifests/input.pp b/manifests/input.pp index f3484b87..94cc7276 100644 --- a/manifests/input.pp +++ b/manifests/input.pp @@ -85,7 +85,7 @@ content => template("${module_name}/${input_template}"), validate_cmd => $validate_cmd, notify => Service['filebeat'], - require => File['filebeat.yml'], + require => Class['filebeat::config'], } } diff --git a/manifests/install.pp b/manifests/install.pp index fd65f4e7..d169234b 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -13,8 +13,8 @@ } Anchor['filebeat::install::begin'] -> Class['filebeat::install::linux'] -> Anchor['filebeat::install::end'] if $::filebeat::manage_repo { - class { '::filebeat::repo': } - Class['filebeat::repo'] -> Class['filebeat::install::linux'] + include elastic_stack::repo + Class['elastic_stack::repo'] -> Class['filebeat::install::linux'] } } 'FreeBSD': { diff --git a/manifests/params.pp b/manifests/params.pp index fbd6957f..769d6095 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -19,7 +19,7 @@ $enable_conf_modules = false $fields = {} $fields_under_root = false - $http = {} + $http = { 'enabled' => false } $cloud = {} $outputs = {} $shipper = {} @@ -33,6 +33,8 @@ $xpack = undef $systemd_override_dir = '/etc/systemd/system/filebeat.service.d' $systemd_beat_log_opts_template = "${module_name}/systemd/logging.conf.erb" + $systemd_service_template = "${module_name}/systemd/filebeat.service.erb" + $systemd_composite_service_template = "${module_name}/systemd/filebeat.composite.service.erb" # These are irrelevant as long as the template is set based on the major_version parameter # if versioncmp('1.9.1', $::rubyversion) > 0 { diff --git a/manifests/repo.pp b/manifests/repo.pp deleted file mode 100644 index 1ebd75d5..00000000 --- a/manifests/repo.pp +++ /dev/null @@ -1,76 +0,0 @@ -# filebeat::repo -# -# Manage the repository for Filebeat (Linux only for now) -# -# @summary Manages the yum, apt, and zypp repositories for Filebeat -class filebeat::repo { - $debian_repo_url = "https://artifacts.elastic.co/packages/${filebeat::major_version}.x/apt" - $yum_repo_url = "https://artifacts.elastic.co/packages/${filebeat::major_version}.x/yum" - - case $::osfamily { - 'Debian': { - if $::filebeat::manage_apt == true { - include ::apt - } - - Class['apt::update'] -> Package['filebeat'] - - if !defined(Apt::Source['beats']){ - apt::source { 'beats': - ensure => $::filebeat::alternate_ensure, - location => $debian_repo_url, - release => 'stable', - repos => 'main', - pin => $::filebeat::repo_priority, - key => { - id => '46095ACC8548582C1A2699A9D27D666CD88E42B4', - source => 'https://artifacts.elastic.co/GPG-KEY-elasticsearch', - }, - } - } - } - 'RedHat', 'Linux': { - if !defined(Yumrepo['beats']){ - yumrepo { 'beats': - ensure => $::filebeat::alternate_ensure, - descr => 'elastic beats repo', - baseurl => $yum_repo_url, - gpgcheck => 1, - gpgkey => 'https://artifacts.elastic.co/GPG-KEY-elasticsearch', - priority => $::filebeat::repo_priority, - enabled => 1, - notify => Exec['flush-yum-cache'], - } - } - - exec { 'flush-yum-cache': - command => 'yum clean all', - refreshonly => true, - path => ['/bin', '/usr/bin', '/sbin', '/usr/sbin'], - } - } - 'Suse': { - exec { 'topbeat_suse_import_gpg': - command => 'rpmkeys --import https://artifacts.elastic.co/GPG-KEY-elasticsearch', - unless => 'test $(rpm -qa gpg-pubkey | grep -i "D88E42B4" | wc -l) -eq 1 ', - notify => [ Zypprepo['beats'] ], - } - if !defined(Zypprepo['beats']){ - zypprepo { 'beats': - ensure => $::filebeat::alternate_ensure, - baseurl => $yum_repo_url, - enabled => 1, - autorefresh => 1, - name => 'beats', - gpgcheck => 1, - gpgkey => 'https://packages.elastic.co/GPG-KEY-elasticsearch', - type => 'yum', - } - } - } - default: { - fail($filebeat::osfamily_fail_message) - } - } - -} diff --git a/manifests/service.pp b/manifests/service.pp index 4bc01b7c..209fc475 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -4,10 +4,22 @@ # # @summary Manage the filebeat service class filebeat::service { - service { 'filebeat': - ensure => $filebeat::real_service_ensure, - enable => $filebeat::real_service_enable, - provider => $filebeat::service_provider, + if keys($filebeat::outputs).length <= 1 { + service { 'filebeat': + ensure => $filebeat::real_service_ensure, + enable => $filebeat::real_service_enable, + provider => $filebeat::service_provider, + } + } + else { + systemd::unit_file { "filebeat.service": + content => template($filebeat::systemd_composite_service_template), + } + ~> service {'filebeat': + enable => $filebeat::real_service_enable, + ensure => $filebeat::real_service_ensure, + provider => $filebeat::service_provider, + } } $major_version = $filebeat::major_version @@ -65,5 +77,40 @@ } } } +} +define filebeat::service::add { + if $::service_provider == 'systemd' { + if $name == $filebeat::module_name { + $service_name = $name + } + else { + $service_name = "${filebeat::module_name}.${name}" + file { "/var/lib/filebeat/${name}": + ensure => directory, + mode => '0750', + owner => $filebeat::config_file_owner, + group => $filebeat::config_file_group, + before => Systemd::Unit_file["${filebeat::module_name}.${name}.service"], + } + file { "/var/log/filebeat/${name}": + ensure => directory, + mode => '0700', + owner => $filebeat::config_file_owner, + group => $filebeat::config_file_group, + before => Systemd::Unit_file["${filebeat::module_name}.${name}.service"], + } + } + systemd::unit_file { "${service_name}.service": + content => template($filebeat::systemd_service_template), + } + ~> service {"${service_name}": + enable => $filebeat::real_service_enable, + ensure => $filebeat::real_service_ensure, + provider => $filebeat::service_provider, + } + } + else { + warning("You\'re trying to add service to systemd for the additional output '${name}', but the system is using '${::service_provider}' instead of systemd.") + } } diff --git a/metadata.json b/metadata.json index f2fa1d87..b5949fde 100644 --- a/metadata.json +++ b/metadata.json @@ -27,6 +27,14 @@ { "name": "puppetlabs/yumrepo_core", "version_requirement": ">= 1.0.0 < 2.0.0" + }, + { + "name": "camptocamp-systemd", + "version_requirement": ">= 2.0.0 < 3.0.0" + }, + { + "name": "elastic-elastic_stack", + "version_requirement": ">= 7.0.0 < 8.0.0" } ], "operatingsystem_support": [ diff --git a/templates/systemd/filebeat.composite.service.erb b/templates/systemd/filebeat.composite.service.erb new file mode 100644 index 00000000..d6c09b02 --- /dev/null +++ b/templates/systemd/filebeat.composite.service.erb @@ -0,0 +1,13 @@ +[Unit] +Description=Filebeat composite service to start multiple outputs. +Documentation=https://www.elastic.co/products/beats/filebeat +Wants=network-online.target +After=network-online.target + +[Service] +Type=oneshot +ExecStart=/bin/true +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/templates/systemd/filebeat.service.erb b/templates/systemd/filebeat.service.erb new file mode 100644 index 00000000..dd600961 --- /dev/null +++ b/templates/systemd/filebeat.service.erb @@ -0,0 +1,15 @@ +[Unit] +Description=Filebeat sends log files to <%= @name %>. +Documentation=https://www.elastic.co/products/beats/filebeat +Wants=network-online.target +After=network-online.target + +[Service] +Environment="BEAT_LOG_OPTS=" +Environment="BEAT_CONFIG_OPTS=-c /etc/filebeat/filebeat.<%= @name %>.yml" +Environment="BEAT_PATH_OPTS=--path.home /usr/share/filebeat --path.config /etc/filebeat --path.data /var/lib/filebeat/<%= @name %> --path.logs /var/log/filebeat/<%= @name %>" +ExecStart=/usr/share/filebeat/bin/filebeat --environment systemd $BEAT_LOG_OPTS $BEAT_CONFIG_OPTS $BEAT_PATH_OPTS +Restart=always + +[Install] +WantedBy=filebeat.service