Created
May 19, 2020 01:13
-
-
Save charrismatic/80de258bac9fb6c701673f3d0bfe7025 to your computer and use it in GitHub Desktop.
ServerOps IP Tools
This file contains hidden or 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/bash | |
# FILTERS IP ADDRESSES FROM LOG | |
# USAGE: find /var/log -type f -exec cat {} \; | get-ips.sh | |
grep \ | |
--only-matching \ | |
--color=never \ | |
-E "[0-9]{1,3}\.[1-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" \ | |
| sort --version-sort \ | |
| uniq -c \ | |
| sort -r \ | |
--version-sort \ | |
--ignore-leading-blanks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment