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
"$FIRST_FINDING" || echo "," >> $JSONFILE
finding=$(strip_quote "$3")
finding=$(newline_to_spaces "$(strip_quote "$3")")
echo -e "
{
'id' : '$1',
'ip' : '$NODE/$NODEIP',
'port' : '$PORT',
'severity' : '$2',
'finding' : '$finding'
\"id\" : \"$1\",
\"ip\" : \"$NODE/$NODEIP\",
\"port\" : \"$PORT\",
\"severity\" : \"$2\",
\"finding\" : \"$finding\"
}" >> $JSONFILE
fi
# does the following do any sanitization?