Created
January 8, 2015 10:07
-
-
Save EdGuiness/c815f99d2bcb42714165 to your computer and use it in GitHub Desktop.
Dump IP addresses with count from IIS log file
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
| use strict;use warnings; | |
| my %ipaddrs; | |
| while (<DATA>) { | |
| while (/\b(\d+\.\d+\.\d+\.\d+)\b/g) { | |
| $ipaddrs{$&}++; | |
| } | |
| } | |
| foreach my $ip (keys %ipaddrs) { | |
| print "$ip\t$ipaddrs{$ip}\n"; | |
| } | |
| __DATA__ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also...
...utils\sort --key=2 -n -rto sort output descending numeric order