Fixed duplicate '__' in Perf Data output

This commit is contained in:
Lord Hepipud 2019-10-07 16:30:55 +02:00
parent ec65058f76
commit 409d532ae0

View file

@ -4,6 +4,11 @@ function Format-IcingaPerfDataLabel()
$PerfData
);
# Remove all special characters and spaces on label names
return ((($PerfData) -Replace ' ', '_') -Replace '[\W]', '');
$Output = ((($PerfData) -Replace ' ', '_') -Replace '[\W]', '');
while ($Output.Contains('__')) {
$Output = $Output.Replace('__', '_');
}
# Remove all special characters and spaces on label names
return $Output;
}