NGINX REQ/SEC: parse log

YURII DE. - Aug 26 '22 - - Dev Community

The output of the above-given command will sort out all of the requests while putting a timestamp with each of them. Here, the first number represents the request count:

sudo cat /var/log/nginx/access.log | awk '{print $4}' | uniq -c | sort -rn | head
Enter fullscreen mode Exit fullscreen mode
    683 [26/Aug/2022:04:04:32
    642 [26/Aug/2022:05:59:46
    629 [26/Aug/2022:05:01:55
    604 [26/Aug/2022:07:53:47
    556 [26/Aug/2022:15:02:34
    551 [26/Aug/2022:06:57:02
    548 [26/Aug/2022:08:48:05
    521 [26/Aug/2022:09:37:22
    466 [26/Aug/2022:07:53:46
    447 [26/Aug/2022:15:02:35
Enter fullscreen mode Exit fullscreen mode
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .