Created
March 13, 2018 18:26
-
-
Save flrichar/75b0e29862efedeaa08e07ca5b539dd3 to your computer and use it in GitHub Desktop.
parse v4 ip with perl
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
| #!/usr/bin/perl | |
| ## extracts all ips from log file | |
| while (<>) { | |
| chomp; | |
| if (/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/) { | |
| print "$&\n"; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment