Skip to content

Commit

Permalink
Revert "Add support for the 'filestream' input type (pcfens#297)"
Browse files Browse the repository at this point in the history
This reverts commit c8bc5b4.
  • Loading branch information
shamil committed May 24, 2022
1 parent f0fcf70 commit aa6c356
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 218 deletions.
7 changes: 1 addition & 6 deletions lib/facter/filebeat_version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'facter'
Facter.add('filebeat_version') do
confine 'kernel' => ['FreeBSD', 'OpenBSD', 'Linux', 'Windows', 'SunOS']
confine 'kernel' => ['FreeBSD', 'OpenBSD', 'Linux', 'Windows']
if File.executable?('/usr/bin/filebeat')
filebeat_version = Facter::Util::Resolution.exec('/usr/bin/filebeat version')
if filebeat_version.empty?
Expand All @@ -11,11 +11,6 @@
if filebeat_version.empty?
filebeat_version = Facter::Util::Resolution.exec('/usr/local/bin/filebeat --version')
end
elsif File.executable?('/opt/local/bin/filebeat')
filebeat_version = Facter::Util::Resolution.exec('/opt/local/bin/filebeat version')
if filebeat_version.empty?
filebeat_version = Facter::Util::Resolution.exec('/opt/local/bin/filebeat --version')
end
elsif File.executable?('/usr/share/filebeat/bin/filebeat')
filebeat_version = Facter::Util::Resolution.exec('/usr/share/filebeat/bin/filebeat --version')
elsif File.executable?('/usr/local/sbin/filebeat')
Expand Down
11 changes: 4 additions & 7 deletions manifests/input.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
String $syslog_host = 'localhost:5140',
Boolean $cri_parse_flags = false,
String $encoding = 'plain',
String $input_type = $filebeat::params::default_input_type,
String $input_type = 'log',
Hash $fields = {},
Boolean $fields_under_root = $filebeat::fields_under_root,
Hash $ssl = {},
Expand Down Expand Up @@ -54,12 +54,9 @@
Optional[String] $max_message_size = undef,
) {

if versioncmp($facts['filebeat_version'], '7.16') > 0 {
$input_template = 'filestream.yml.erb'
} elsif versioncmp($facts['filebeat_version'], '6') > 0 {
$input_template = 'input.yml.erb'
} else {
$input_template = 'prospector.yml.erb'
$input_template = $filebeat::major_version ? {
'5' => 'prospector.yml.erb',
default => 'input.yml.erb',
}

if 'filebeat_version' in $facts and $facts['filebeat_version'] != false {
Expand Down
6 changes: 0 additions & 6 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,4 @@
fail($kernel_fail_message)
}
}

if versioncmp($facts['filebeat_version'], '7.16') > 0 {
$default_input_type = 'filestream'
} else {
$default_input_type = 'log'
}
}
199 changes: 0 additions & 199 deletions templates/filestream.yml.erb

This file was deleted.

0 comments on commit aa6c356

Please sign in to comment.