I have the format in nginx access log defined like

log_format combined_ssl_host '$remote_addr - $remote_user [$time_local] '
                             '$host $ssl_protocol '
                             '"$request" $status r=$request_length(b:$content_length) s=$bytes_sent(b:$body_bytes_sent) '
                             '"$http_referer" "$http_user_agent" '
                             '$request_time $upstream_response_time $pipe';

how can I parse the slowest requests from a log of this format.

one log line for example looks like

11.118.143.42 - - [07/Nov/2018:06:25:17 +0000] www.site.com TLSv1.2 "POST /aaaa/bbbb/cccc? HTTP/1.1" 200 r=538(b:170) s=324(b:44) "-" "rest-client/2.0.2 (linux-musl x86_64) ruby/2.3.6p384" 0.003 0.003 .
  • Try sort -nrk17 logfile where 17 is the field number. – Valentin Bajrami Nov 8 at 21:46

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.