Skip to content

Instantly share code, notes, and snippets.

@gilbertw1
Created March 30, 2020 15:56
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 gilbertw1/f923d4404a66013b16d65ab95b32551e to your computer and use it in GitHub Desktop.
Save gilbertw1/f923d4404a66013b16d65ab95b32551e to your computer and use it in GitHub Desktop.
nginx log format
const NGINX_FORMAT_STRING: &str = r#"$textField[name='ip'] - $textField[name='username', null='-'] $delimited[start='[', end=']']{$dateField[name='date', format='%d/%b/%Y:%H:%M:%S %z']} $delimited[delim='"']{$opt{$textField[name='method'] }$textField[name='path']$opt{?$textField[name='query']} $textField[name='protocol']} $numberField[name='status'] $numberField[name='bytes'] $delimited[delim='"']{$textField[name='referrer', null='-']} $delimited[delim='"']{$textField[name='user_agent', null='-']}"#;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment