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
### Keybase proof | |
I hereby claim: | |
* I am danielmiessler on github. | |
* I am danielmiessler (https://keybase.io/danielmiessler) on keybase. | |
* I have a public key whose fingerprint is C7D4 8DA8 35A4 5E83 3FC6 0ECA 79CB A58E D1BB 075F | |
To claim this, I am signing this object: |
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
#!/usr/bin/env bash | |
cat /var/log/apache2/ | awk '{print $1}' > ips.txt | |
uniq ips.txt > uniques.txt | |
IPS='cat uniques.txt' | |
echo "" > ./ipinfo.csv | |
for i in $IPS | |
do | |
echo "$i,'host $i | awk '{print $5}'','geoiplookup $i | cut -d "," -f2 | sed -e 's/^[ \t]*//'','geoiplookup -f /usr/share/GeoIP/GeoLiteCity.dat $i | cut -d "," -f3 | sed -e 's/^[ \t]*//'','geoiplookup -f /usr/share/GeoIP/GeoLiteCity.dat $i | cut -d "," -f4 | sed -e 's/^[ \t]*//''" >> ipinfo.csv | |
done |
NewerOlder