Skip to content

Instantly share code, notes, and snippets.

@laurynas
Created March 8, 2012 13:48
Show Gist options
  • Save laurynas/2001050 to your computer and use it in GitHub Desktop.
Save laurynas/2001050 to your computer and use it in GitHub Desktop.
Extract IPs while tailing log file
tail -f log/development.log | grep "[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}" | awk 'match($0,/([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/){ print substr($0, RSTART, RLENGTH) }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment