diladele / websafety

Simple and powerful web filter for HTTP and HTTPS traffic
https://www.diladele.com/websafety/
244 stars 24 forks source link

how to log query terms to some domains only (to minimize amount of info stored in the logs) #1514

Open ra-at-diladele-com opened 4 years ago

ra-at-diladele-com commented 4 years ago

I have below option globally, which I don't want to make "off" strip_query_terms on

acl track dstdomain "/etc/squid/sites_track.txt" access_log /var/log/squid/full_site_links.log squid_custom track

however for specific ACL I would like to log full URL with query parameters, how this can be done ?

I have not tested this, and the results may be version-dependent, but according to logformat documentation[1], %ru honors strip_query_terms while %>ru does not:

logformat strippedFormat %ts... %ru ...
access_log ... strippedFormat track !specific_ACL

logformat detailedFormat %ts... %>ru ...
access_log ... detailedFormat track specific_ACL

[1] http://www.squid-cache.org/Doc/config/logformat/

ra-at-diladele-com commented 4 years ago

Need to confirm if this works. Would be very useful for youtube/google reporting.