fix json output

use double quotes instead of single quotes
delete newlines from strings
This commit is contained in:
Sietse van der Molen 2016-02-12 11:05:36 +01:00
parent 70cd658447
commit b2e4df60ca

View File

@ -457,14 +457,14 @@ fileout() { # ID, SEVERITY, FINDING
if "$do_json"; then if "$do_json"; then
"$FIRST_FINDING" || echo "," >> $JSONFILE "$FIRST_FINDING" || echo "," >> $JSONFILE
finding=$(strip_quote "$3") finding=$(newline_to_spaces "$(strip_quote "$3")")
echo -e " echo -e "
{ {
'id' : '$1', \"id\" : \"$1\",
'ip' : '$NODE/$NODEIP', \"ip\" : \"$NODE/$NODEIP\",
'port' : '$PORT', \"port\" : \"$PORT\",
'severity' : '$2', \"severity\" : \"$2\",
'finding' : '$finding' \"finding\" : \"$finding\"
}" >> $JSONFILE }" >> $JSONFILE
fi fi
# does the following do any sanitization? # does the following do any sanitization?