C
C
cru5ader2017-03-28 13:00:31
linux
cru5ader, 2017-03-28 13:00:31

Parsing nginx log for long-running scripts?

Hello everyone, I can't parse the nginx log into long running scripts. allow more than 10 seconds

1.5.3.255 - - [18/Mar/2017:00:01:23 +0300] 42833825/6 200    3.561/3.561s        621/766b        1.23x - TLSv1.2-.       -       "GET /ib1/rest/v1/getCli
8.2.1.1 - - [18/Mar/2017:00:01:23 +0300]  42833684/7  200    10.007/0.007s        5133/3241b      1.29x - TLSv1.2-.       -       "POST /ib1/wf1/retail/ca

I'm interested in the value for example 10.007/0.007s,
In the request:
awk '$8 > 10 {print }' /web_logs/nginx/access.old | awk '{print $8 " " $15}' | sort | uniq -c | sort -rn |head -20 outputs
data where the execution time is less than 10 seconds, i.e. with a value of 3.561/3.561s
What is the correct way to parse the data?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Konyukhov, 2017-03-28
@cru5ader

awk '{print $8, $NF}' log | sed -E '[email protected]([0-9]+)\.([0-9]+)/@\1.\2 @g' | awk '{if ($1 > 10) print $0}' |  sort | uniq -c | sort -rn |head -20

output from your example:
1 10.007 0.007s /ib1/wf1/retail/ca

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question