fix(include/outputs):Rolling back whitelist checking to RE check (#1037)

* fix(include/outputs):Rolling back whitelist checking to RE check

* fix(include/ouputs): Clarified variable assignation coming from argument
This commit is contained in:
n4ch04
2022-02-14 13:04:47 +01:00
committed by GitHub
parent b4669a2a72
commit 3097ba6c66

View File

@@ -171,14 +171,14 @@ textFail(){
ignore_check_name="${excluded_item%%:*}" # Check name is everything up to the first :
# Resource value is the second field of line included in whitelist divided by :
resource_value=$(awk -F ":" '{print $2}' <<< $excluded_item)
# Checked value is the second field of log message divided by spaces
checked_value=$(awk '{print $2}' <<< $1)
# Checked value is the whole log message that comes as argument
checked_value=$1
if [[ "${ignore_check_name}" != "${CHECK_NAME}" ]]; then
# not for this check
continue
fi
# To set WARNING flag both values must be exactly the same
if [[ "${checked_value}" == "${resource_value}" ]]; then
if [[ "${checked_value}" == *"${resource_value}"* ]]; then
level="WARNING"
colorcode="${WARNING}"
break