Re: How can I remove backslash when log format use escape=json
I see, really thanks to your advice. Posted at Nginx Forum: https://forum.nginx.org/read.php?2,281635,281642#msg-281642 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx
How can I remove backslash when log format use escape=json
Hi, I want to log my entire request_body, but access.log contains some strange backslash, how can I remove these backslash before doube quote? Here is my nginx.conf, ``` log_format main escape=json '$request_body'; access_log logs/access.log main; ``` This is my request code: ``` fetch('http://localhost:8080/njs',{ method:'POST', body:JSON.stringify({ text:'message with backslash' }) }).then(res=>res.json()).then((res)=>{ console.info(res) }) ``` And access.log ``` {\"text\":\"message with backslash\"} ``` But I think it should be ``` {"text":"message with backslash"} ``` Posted at Nginx Forum: https://forum.nginx.org/read.php?2,281634,281634#msg-281634 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx
Re: Where can I find nginScript shell
I find the associated code, thanks for your help, but I'm not familiar with how to building the nginScript shell, I think it's better add instruction in README.Also, nginScript is really really awesome. Posted at Nginx Forum: https://forum.nginx.org/read.php?2,278033,278035#msg-278035 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx
Where can I find nginScript shell
$ njs interactive njscript v. -> the properties and prototype methods of v. type console.help() for more information >> var my_data = '{"colors":[{"name":"red","fancy":"brick dust"}, {"name":"blue","fancy":"sea spray"}]}'; >> var my_object = JSON.parse(my_data); >> my_object.colors[1].fancy; sea spray >> I found this in https://www.nginx.com/blog/nginx-plus-r14-released/ ,but where can I download? Posted at Nginx Forum: https://forum.nginx.org/read.php?2,278033,278033#msg-278033 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx