Last active
January 14, 2021 17:17
-
-
Save kartikeytewari/15afa6aa9cecf41180bbde102dec1ba9 to your computer and use it in GitHub Desktop.
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
cat /var/log/qeats-server.log | egrep -o '([0-9]{1,3}\.){3}[0-9]{1,3}' | sort | uniq > temp_file | |
cat temp_file | while read line | |
do | |
curl "https://tools.keycdn.com/geo.json?host=$line" 2>/dev/null | jq .data.geo.country_name >>country_name_of_requests | |
done | |
cat country_name_of_requests | sort | uniq | |
rm temp_file | |
rm country_name_of_requests |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment