Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # may not play nice with really huge logs unless your station has plenty of RAM
- printf "\n\ntop 10 ips with inbound messages\n"
- printf "=================================================================\n"
- grep "inbound message" $1| grep -Eo "([0-9]{1,3}\.){3}[0-9]{1,3}" | sort -rn | uniq -c | sort -rn | head
- printf "\n\nlast line of the top 10 inbound ips\n"
- printf "=================================================================\n"
- for i in `grep "inbound message" $1 | grep -Eo "([0-9]{1,3}\.){3}[0-9]{1,3}" | sort -rn | uniq -c | sort -rn | head `
- do
- # echo 'i = '${i}
- if [[ ${i} =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
- tac $1 | grep "inbound message" $1 | grep -m1 ${i}
- fi
- done
- printf "\n\ntop 10 account logins\n"
- printf "=================================================================\n"
- sed 's/^.*sip//' $1 | grep "Successful login" | sort -rn | uniq -c | sort -rn | head
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement