Skip to content

Commit 3bc1653

Browse files
authored
Dependency for secure log parser
pulls out counts of fails and de-dupes
1 parent 48e43c6 commit 3bc1653

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

get_fails.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
#grep "failure;" /var/log/secure | awk -F "=" '{print$7}' | awk '{print$1}' | sort | uniq -c | sort -rn > failed_login_ips.txt
3+
#
4+
AUTHLOGS=/var/log/secure
5+
OUTFILE=/root/failed_login_ips.txt
6+
#
7+
get_failed_auths () {
8+
grep "failure;" $AUTHLOGS | awk -F "=" '{print$7}' | awk '{print$1}' | sort | uniq -c | sort -rn > $OUTFILE
9+
}
10+
get_failed_auths

0 commit comments

Comments
 (0)