I have an open resty nginx with lua code that enhance the data and then I write this data to the access log for data analysis. The data that the lua code produce includes double quotes but nginx write it to the access log as \x22. Can I disable this behaviour or decode it back to "?
Asked
Active
Viewed 1,774 times
2
-
2You can't. It's hardcoded in log module – Alexey Ten Jun 04 '15 at 07:55
-
OK. It is good to know. I will try other solutions. – Gluz Jun 04 '15 at 09:02
-
Is there other way to send data from the lua code to the nginx? – Gluz Jun 04 '15 at 09:05
-
@AlexeyTen, you should write your comment as an answer. It is a legitimate answer. – Gluz Jun 07 '15 at 07:14
1 Answers
4
Short answer you can't. But, you can run an URL decode after logrotate.
Here is the command :
awk -v RS='\\\\x[0-9]{2}' 'RT{ORS=sprintf("%c", strtonum("0" substr(RT, 2)))} 1'

Abhi
- 6,471
- 6
- 40
- 57

Shai Brumer
- 56
- 2