From 4bfbc19f477279c0f1164bc038c17b033fafd9cc Mon Sep 17 00:00:00 2001 From: teastep Date: Sat, 29 Jun 2002 22:41:30 +0000 Subject: [PATCH] Enhanced 'hits' command git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@99 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall/shorewall | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Shorewall/shorewall b/Shorewall/shorewall index 79e8290af..a14bb0471 100755 --- a/Shorewall/shorewall +++ b/Shorewall/shorewall @@ -589,18 +589,24 @@ case "$1" in if [ `grep -c "Shorewall:" $LOGFILE ` -gt 0 ] ; then echo " HITS IP DATE" + echo " ---- --------------- ------" grep "Shorewall:" $LOGFILE | sed 's/\(.\{6\}\)\(.*SRC=\)\(.*\)\( DST=.*\)/\3 \1/' | sort | uniq -c | sort -rn echo "" - echo " HITS IP" - grep "Shorewall:" $LOGFILE | sed 's/\(.*SRC=\)\(.* \)\(DST=.*\)/\2/' | sort | uniq -c | sort -rn + echo " HITS IP PORT" + echo " ---- --------------- -----" + grep "Shorewall:" $LOGFILE | sed 's/\(.*SRC=\)\(.*\)\( DST=.*DPT=\)\([0-9]\{1,5\}\)\(.*\)/\2 \4/ + t + s/\(.*SRC=\)\(.*\)\( DST=.*\)/\2/' | sort | uniq -c | sort -rn echo "" echo " HITS DATE" + echo " ---- ------" grep "Shorewall:" $LOGFILE | sed 's/\(.\{6\}\)\(.*\)/\1/' | sort | uniq -c | sort -rn echo "" echo " HITS PORT SERVICE(S)" + echo " ---- ----- ----------" grep 'Shorewall:.*DPT' $LOGFILE | sed 's/\(.*DPT=\)\([0-9]\{1,5\}\)\(.*\)/\2/' | sort | uniq -c | sort -rn | \ while read count port ; do # List all services defined for the given port