View Alfredo Tigolo III's profile on LinkedIn

Sunday, June 26, 2011

Pulling web sites accessed using bash script

#Squid is also capable of reading files containing lists of web sites with awk

#!/bin/sh
# at3 3-1-09
#source:
#http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch32_:_Controlling_Web_Access_w
ith_Squid#Password_Authentication_Using_NCSA
# description: pulls the url address off the squid access.log file
# usage: ~/home/geturl *must be in squid var/logs diretory
# the delimiters are http:// and /
#geturl.bsh

more $1 | awk -F'http://' '{ print $2 }' | uniq -u | awk -F/ '{ print $1 }' | sort | uniq -u

No comments: