Last active
January 7, 2021 16:31
-
-
Save karmanyaahm/f920115dc05ee69c264cd7f90440c0d2 to your computer and use it in GitHub Desktop.
ip address info from nginx logs or any similar logs
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 access.log access.log.1 | grep '/t.json' | awk '{print $1}' | sort | uniq | xargs -L1 -I % curl "https://freegeoip.app/json/%" | tee -a ~/log.log |
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 access.log access.log.1 | grep '/t.json' | awk '{print $1}' | sort | uniq -c | sort|awk '{printf("%d ", $1); system("curl https://freegeoip.app/json/" $2)}'|tee -a ~/log2.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment