HTTP collectors and exporters retain all newline characters in HTTP and XML data. To strip the newlines, add the following expression to the attribute expressions that use the data from the HTTP collector or exporter.
.replaceAll(in.value, "[\r\n]", ""
JSON data automatically replaces newlines with spaces.