Advertisement
roganhamby

Sip Summary Script

Jul 1st, 2015
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.93 KB | None | 0 0
  1. #!/bin/bash
  2. # may not play nice with really huge logs unless your station has plenty of RAM
  3.  
  4. printf "\n\ntop 10 ips with inbound messages\n"
  5. printf "=================================================================\n"
  6. grep "inbound message" $1| grep -Eo "([0-9]{1,3}\.){3}[0-9]{1,3}" | sort -rn | uniq -c | sort -rn | head
  7.  
  8. printf "\n\nlast line of the top 10 inbound ips\n"
  9. printf "=================================================================\n"
  10. 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 `
  11. do
  12.     # echo 'i = '${i}
  13.      if [[ ${i} =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
  14.         tac $1 | grep "inbound message" $1 | grep -m1 ${i}
  15.     fi
  16. done
  17.  
  18. printf "\n\ntop 10 account logins\n"
  19. printf "=================================================================\n"
  20. sed 's/^.*sip//' $1 | grep "Successful login" | sort -rn | uniq -c | sort -rn | head
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement