#!/bin/bash
IFS= read -r -d '' ns_log <<'EOF'
  ...content...
more content here
EOF
ns_log=${ns_log//[[:space:]]/} ## replace all whitespace with the empty string
printf '%s\n' "$ns_log"        ## the quotes are important!