Skip to content

Instantly share code, notes, and snippets.

@focustrate
Created October 7, 2013 14:26
Show Gist options
  • Save focustrate/6868884 to your computer and use it in GitHub Desktop.
Save focustrate/6868884 to your computer and use it in GitHub Desktop.
1. parse unique IPs from file of access log entries (store to a file) 2. run whois against all of them (store to another file)
# grep -oP "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" file_of_access_log_entries | sort -u > file_of_ip_addresses
# xargs -L1 whois < file_of_ip_addresses > file_of_whois_output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment