You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 7, 2026. It is now read-only.
As the title says, data from the file are not formatted for json. Any double quotes or backslashes will break the json formatting. I have to do this with sed manually for each logfile.
sed 's/\\\\/\\\\\\\\/g' file.log | sed 's/"/\\\\"/g' > file-out.log
The formatting of sed backslashes is weird because of drone.yml also escapes backslashes.
Complete working escaping step:
- name: Escape json
image: alpine
commands:
- sed 's/\\\\/\\\\\\\\/g' output.log | sed 's/"/\\\\"/g' > output-out.log
I would suggest to use a kind of json escaping library, I do not know if my solution of replacing just \ with \\ and " with \" has any edge cases.
As the title says, data from the file are not formatted for json. Any double quotes or backslashes will break the json formatting. I have to do this with sed manually for each logfile.
The formatting of sed backslashes is weird because of drone.yml also escapes backslashes.
Complete working escaping step:
I would suggest to use a kind of json escaping library, I do not know if my solution of replacing just
\with\\and"with\"has any edge cases.