diff --git a/output_lib.sh b/output_lib.sh index 384dfe0..efef321 100644 --- a/output_lib.sh +++ b/output_lib.sh @@ -93,4 +93,12 @@ resulttestjson() { itemsJson=$(printf "["; ISEP=""; ITEMCOUNT=0; for item in $truncItems; do printf "%s\"%s\"" "$ISEP" "$item"; ISEP=","; done; printf "]") printf "\"result\": \"%s\", \"details\": \"%s: %s\", \"items\": %s}" "$1" "$2" "$truncItems" "$itemsJson" | tee -a "$logger.json" 2>/dev/null 1>&2 fi + # Log remediation measure + if [ ! -z "$remediation" ]; then + printf ", \"remediation\": \"%s\"" "$remediation" | tee -a "$logger.json" 2>/dev/null 1>&2 + if [ ! -z "$remediationImpact" ]; then + printf ", \"remediation-impact\": \"%s\"" "$remediationImpact" | tee -a "$logger.json" 2>/dev/null 1>&2 + fi + fi + printf "}" | tee -a "$logger.json" 2>/dev/null 1>&2 }