initial public commit
authorgit <redacted>
Sun, 3 May 2026 09:50:20 +0000 (05:50 -0400)
committergit <redacted>
Sun, 3 May 2026 09:50:20 +0000 (05:50 -0400)
README.md [new file with mode: 0644]
chckip [new file with mode: 0755]
countconn [new file with mode: 0755]
esearchlog [new file with mode: 0755]
searchlog [new file with mode: 0755]

diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..833c2b0
--- /dev/null
+++ b/README.md
@@ -0,0 +1,17 @@
+All scripts assume the default config format and the default log file structure ( regular `.log` and `.log.1` files, every other log file gzip'ed)
+
+### searchlog
+
+grep all `access.log*` files
+
+### esearchlog
+
+grep all `error.log*` files
+
+### chckip
+
+grep all `access.log*` files and perform reverse IP lookup on IPs from matched entries
+
+### countconn
+
+show connection per minute
diff --git a/chckip b/chckip
new file mode 100755 (executable)
index 0000000..c2d8afe
--- /dev/null
+++ b/chckip
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+SERVER=$(which > /dev/null apache2 && printf "apache2" || which > /dev/null nginx && printf "nginx" || printf "ERROR: server not detected, needs to be set manually")
+
+{ zcat /var/log/"$SERVER"/access.log.*.gz; cat /var/log/"$SERVER"/access.log /var/log/"$SERVER"/access.log.1; } | grep -a "$@" | awk '{print $1}' | sort | uniq | xargs -L 1 host
diff --git a/countconn b/countconn
new file mode 100755 (executable)
index 0000000..0652279
--- /dev/null
+++ b/countconn
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+SERVER=$(which > /dev/null apache2 && printf "apache2" || which > /dev/null nginx && printf "nginx" || printf "ERROR: server not detected, needs to be set manually")
+
+[ "$1" -eq "$1" ] 2>/dev/null && NUM="$1" || NUM=30
+
+cut -d: -f2,3 < /var/log/"$SERVER"/access.log | uniq -c | tail -n"$NUM"
diff --git a/esearchlog b/esearchlog
new file mode 100755 (executable)
index 0000000..044f1b7
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+SERVER=$(which > /dev/null apache2 && printf "apache2" || which > /dev/null nginx && printf "nginx" || printf "ERROR: server not detected, needs to be set manually")
+
+{ zcat /var/log/"$SERVER"/error.log.*.gz; cat /var/log/"$SERVER"/error.log /var/log/"$SERVER"/error.log.1; } | grep --color=auto -a "$@"
diff --git a/searchlog b/searchlog
new file mode 100755 (executable)
index 0000000..9d16e63
--- /dev/null
+++ b/searchlog
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+SERVER=$(which > /dev/null apache2 && printf "apache2" || which > /dev/null nginx && printf "nginx" || printf "ERROR: server not detected, needs to be set manually")
+
+{ zcat /var/log/"$SERVER"/access.log.*.gz; cat /var/log/"$SERVER"/access.log /var/log/"$SERVER"/access.log.1; } | grep --color=auto -a "$@"