echo "Running query..."

echo "\
select c_client_addr,pl_endp.time_stamp,host,uri  \
from \
n_http_evt_req \
join n_http_req_line on (n_http_evt_req.request_id = n_http_req_line.request_id) \
join pl_endp on (n_http_req_line.pl_endp_id = pl_endp.event_id) \
where \
host = 'www.getmyip.org' or \
host = 'getmyip.co.uk' or \
host = 'www.whatsmyipaddress.com' or \
host = 'www.whatismyip.org' or \
host = 'checkip.dyndns.org' or \
( host = 'schemas.xmlsoap.org' and uri = '/soap/envelope/' ) or \
( host = 'schemas.xmlsoap.org' and uri = '/soap/encoding/' ) or \
host = 'trafficconverter.biz' or \
( host = 'maxmind.com' and uri = '/download/geoip/database/GeoIP.dat.gz' ) \
;" | psql -U postgres uvm

