Skip to content

Instantly share code, notes, and snippets.

@tristandostaler
Created July 8, 2016 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tristandostaler/8bf1c42ec2d8d071d145509e4f479848 to your computer and use it in GitHub Desktop.
Save tristandostaler/8bf1c42ec2d8d071d145509e4f479848 to your computer and use it in GitHub Desktop.
script to count the number of occurence of an IP in the logs (used with a router)
#/bin/sh
sudo grep "SRC=" /var/log/kern.log |awk '{print $10}' | sort | uniq -c |sort -n |sed 's/SRC=//g' | sed 's/DST//g' | sed 's/DS//g' | sed 's/D//g' $
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment