Note that newlines in values must be encoded as \n in JSON. A JSON parser would decode these as real newlines. Insertin a literal newline in a value in a JSON file would result in a broken JSON document.
Using jo (a tool for generating JSON output in the shell, with the correct encoding etc.):
awkresult='some string
with newlines
the end'
jo result="$awkresult"
This would result in the output
{"result":"some string\nwith newlines\nthe end"}
To pretty print:
jo -p result="$awkresult"
which results in
{
"result": "some string\nwith newlines\nthe end"
}
Redirect the output of jo to a file to save the output, e.g.
jo result="$awkresult" >result.json