Skip to main content
Solved

JSON Writer Line Endings Are Wrong


Forum|alt.badge.img

Using a JSONFormatter (pretty) and JSON Writer in series, the output file contains literally the characters \\r\\n with no actual line returns. Snippet of the output:

"_formatted":"{\\r\\n \\"request\\" : [\\r\\n {\\r\\n \\"addDate\\" : \\"/Date(1449794160000-0600)/\\",......

Connecting an Inspector to the to the formatter works as expected.

I should mention that I am using the 2016.1 Beta version (for the Elasticsearch goodness it contains.)

Best answer by takashi

Hi @t1, looks like you have written the entire json document as a string value of a json object member. If you need to write the formatted json document as a json document, you can use the Text File writer, rather than the JSON writer.

View original
Did this help you find an answer to your question?

2 replies

takashi
Influencer
  • Best Answer
  • March 9, 2016

Hi @t1, looks like you have written the entire json document as a string value of a json object member. If you need to write the formatted json document as a json document, you can use the Text File writer, rather than the JSON writer.


Forum|alt.badge.img
  • Author
  • March 9, 2016
takashi wrote:

Hi @t1, looks like you have written the entire json document as a string value of a json object member. If you need to write the formatted json document as a json document, you can use the Text File writer, rather than the JSON writer.

Makes perfect sense now... JSON writer saves attributes as JSON. I just needed to dump my JSON doc to a text file.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings