Created
February 27, 2017 05:57
-
-
Save brucewoodward/210f3765f95200e0691f946e4fc3a697 to your computer and use it in GitHub Desktop.
Show who has been accessing your rails app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Install geoiplookup | |
# Remove the reference to the IP address 69.162.124.237 to play. | |
grep `date '+%Y-%m-%d'` production.log | grep Started | grep -v 69.162.124.237 | awk '{print $10, $12}' | while read path ip | |
do | |
echo `echo $path | sed 's/"//g'` $ip `geoiplookup $ip | awk -F: '{print $NF}'` `nslookup $ip | awk '/arpa/ {print $NF}'` | |
done | sort -u |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment