Skip to content

Instantly share code, notes, and snippets.

@chrismeyersfsu
Created October 22, 2014 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrismeyersfsu/badf93b4fdb4404dd0bf to your computer and use it in GitHub Desktop.
Save chrismeyersfsu/badf93b4fdb4404dd0bf to your computer and use it in GitHub Desktop.
Example of log format with unwanted " hex escaped
http {
log_format haproxy_log '$proxy_protocol_addr' '$haproxy_log_format_base';
server {
set $haproxy_log_format_base '[$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$cookie_connect.sid"';
access_log /var/log/nginx/access.log haproxy_log;
}
}
@chrismeyersfsu
Copy link
Author

The above results in " being escaped:

x.x.x.x[22/Oct/2014:15:30:11 +0000] \x22GET /index.html HTTP/1.1\x22 000 0 \x22\x22 \x22Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36\x22 \x22.sid\x22

This is not the wanted behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment