Skip to content

Commit aed0b0a

Browse files
committed
improve rsyslog_version fact on RedHat, fixes #288
1 parent d31cad4 commit aed0b0a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/facter/rsyslog_version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
when 'RedHat', 'Suse'
1717
if File.exist? '/sbin/rsyslogd'
1818
# Query rsyslogd binary for the version
19-
Facter::Util::Resolution.exec("rsyslogd -v | head -n 1 | awk '{print $2}' | sed 's/,//g'")
19+
Facter::Util::Resolution.exec("rsyslogd -v | sed -n '2q; s/^[^ ]* \([0-9][^ ]*\).*/\1/; s/,//g;p'")
2020
else
2121
# Fall back to rpm to determine version
2222
command = 'rpm -q --qf "%{VERSION}" "rsyslog"'

0 commit comments

Comments
 (0)