Skip to content

Commit 840fc4b

Browse files
committed
fix version detection to work also for version 10
1 parent 3f08609 commit 840fc4b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/splunkconf-init.pl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@
126126
# 20240805 Remove CPUshares to match Splunk 9.3 and replace MemoryLimit with MemoryMax
127127
# 20240805 add both mode for cgroup v1 and v2 in the service file
128128
# 20240806 update systemd service with more cases for recent kernels
129+
# 20250506 fix version detection regex to work also for v10
129130

130131
# warning : if /opt/splunk is a link, tell the script the real path or the chown will not work correctly
131132
# you should have installed splunk before running this script (for example with rpm -Uvh splunk.... which will also create the splunk user if needed)
@@ -135,7 +136,7 @@
135136
use Getopt::Long;
136137

137138
my $VERSION;
138-
$VERSION="20240806a";
139+
$VERSION="20250506a";
139140

140141
print "splunkconf-init version=$VERSION\n";
141142

@@ -568,8 +569,9 @@
568569

569570
# examples
570571
# Splunk 8.0.6 (build 152fb4b2bb96)
572+
# Splunk 10.0.0 (build ef4e484d5eac)
571573
# Splunk Universal Forwarder 9.2.1 (build 78803f08aabb)
572-
my $RES= $VERSIONFULL =~ /Splunk\s+[\w\s]*(\d+)\.(\d+)\.(\d+)/;
574+
my $RES= $VERSIONFULL =~ /Splunk\s+[a-zA-Z\s]*(\d+)\.(\d+)\.(\d+)\s+\(/;
573575
if ($RES) {
574576
$SPLVERSIONMAJ=$1;
575577
$SPLVERSIONMIN=$2;

0 commit comments

Comments
 (0)