From eed6cc73a641db032a7d74b2c967d3826d82bf3e Mon Sep 17 00:00:00 2001 From: Lulzette Date: Sun, 9 Jan 2022 20:31:42 +0000 Subject: [PATCH] nginx logs --- src/index.html | 1 + src/nginx.sh | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 src/nginx.sh diff --git a/src/index.html b/src/index.html index a836202..f7c5dbe 100644 --- a/src/index.html +++ b/src/index.html @@ -1,5 +1,6 @@ wget -q -O - otp-bash.tw1.ru/basic.sh | bash +wget -q -O - otp-bash.tw1.ru/nginx.sh | bash diff --git a/src/nginx.sh b/src/nginx.sh new file mode 100644 index 0000000..4c39a52 --- /dev/null +++ b/src/nginx.sh @@ -0,0 +1,3 @@ +#!/bin/bash +echo "- Sort by IP" +cat /var/log/nginx/access.log | awk '{print $1}' | sort | uniq -c | sort -hr | head -n 30