Skip to content

Instantly share code, notes, and snippets.

@itorres
Created November 7, 2014 01:22
Show Gist options
  • Save itorres/e8f242e292689d1ae6c2 to your computer and use it in GitHub Desktop.
Save itorres/e8f242e292689d1ae6c2 to your computer and use it in GitHub Desktop.
Count wrong registrations by IP in an asterisk logfile
# model:
# [Nov 4 12:26:52] NOTICE[416] chan_sip.c: Registration from '"x" <sip:[email protected]:5060>' failed for '1.2.3.4' - No matching peer found
awk '/failed for/ {count[$12]++}END{for (j in count) printf "%8i %s\n", count[j],j }' messages|sort -n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment