Parsing HTTP records (one-liner)
Monday, August 15th, 2005Extracting tripples (host, referrer, GET) from HTTP connection packets (prints stuff on “.”).
perl -ne ‘$get = $1 if /^GET ([^\s]) /; $host = $1 if /^Host: ([^\s])/; $ref=$1 if /^Referer: ([^\s]*)/; if (/^.$/) { print “ID, $host, $get, $ref\n”;}’