Skip to content

Instantly share code, notes, and snippets.

@sharifulin
Created May 16, 2013 17:32
Show Gist options
  • Save sharifulin/5593499 to your computer and use it in GitHub Desktop.
Save sharifulin/5593499 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use v5.12;
my $line = q(127.0.0.1 - - [15/May/2013:21:35:24 +0000] "GET /hc/cdn-bench.gif?p=http&h=host.example.org&dt=235 HTTP/1.1" 200 43 "http://example.org/blah/?q=Kiev&sort=price.asc&utm_source=yandex&utm_medium=cpc&utm_campaign=s_gen_city_cis_ua_kiev_1565_alldevices_georus&from=earch.no&_openstat=zzz" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1106.241 YaBrowser/1.5.1106.241 Safari/537.4" "0.002" "ostrovok.ru" "1368653724.588" "lucky:92" us:1.1.1.1:80 us_t:0.001);
my $re = qr{\? p=([^&]+) & h=([^&]+) & dt=(\d+) }x;
for (1..3_000_000) {
my @r = $line =~ /$re/;
warn "@r" if $r[2] > 500;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment