Skip to main content
Solved

JSON Writer Line Endings Are Wrong

  • March 8, 2016
  • 2 replies
  • 8 views

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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

takashi
Celebrity
  • 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

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.