Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个开放的resty nginx,带有增强数据的lua代码,然后我将此数据写入访问日志以进行数据分析。lua 代码生成的数据包含双引号,但 nginx 将其作为 \x22 写入访问日志。我可以禁用此行为或将其解码回“?
简短的回答你不能。但是,您可以在 logrotate 之后运行 URL 解码。
这是命令:
awk -v RS='\\\\x[0-9]{2}' 'RT{ORS=sprintf("%c", strtonum("0" substr(RT, 2)))} 1'