[squid-users] url_rewrite_extras - not getting data excepted

Patrick pkryon at gmail.com
Fri May 22 14:44:53 UTC 2015


Hmm, the helper does seem to be working and returning user=X as expected.
In fact the user does show up in Squid's access.log and as configured I
have no other sources for usernames.

I'm not using ICAP (at least intentionally), but switching
to adapted_http_access doesn't not seem to help me.  I switch
my url_rewrite_access from the tee I was running before to a quick script
that logs stdin and returns OK no matter what it gets.

So using...

url_rewrite_extras "%>a/%>A %ue %>rm myip=%la myport=%lp"
url_rewrite_program /opt/idbf-dev/idbf_squid_url_rewrite_test.py

My logs show:

2015-05-22 10:34:59,175 - root - DEBUG    -
http://www.ipchicken.com/images/9.gif 172.20.15.235/pcname.example.com -
GET myip=- myport=3129
2015-05-22 10:34:59,213 - root - DEBUG    -
http://www.ipchicken.com/images/pixel.gif 172.20.15.235/pcname.example.com
- GET myip=- myport=3129
2015-05-22 10:34:59,225 - root - DEBUG    -
http://www.ipchicken.com/images/green.gif 172.20.15.235/pcname.example.com
- GET myip=- myport=3129
2015-05-22 10:34:59,241 - root - DEBUG    -
http://www.ipchicken.com/images/ipc.gif 172.20.15.235/pcname.example.com -
GET myip=- myport=3129
2015-05-22 10:35:01,052 - root - DEBUG    - http://www.ipchicken.com/
172.20.15.235/pcname.example.com - GET myip=- myport=3129

And access.log shows:

1432305299.216     41 172.20.15.235 TCP_MISS/304 270 GET
http://www.ipchicken.com/images/9.gif ryonpk ORIGINAL_DST/209.68.27.16 -
1432305299.256     43 172.20.15.235 TCP_MISS/304 270 GET
http://www.ipchicken.com/images/pixel.gif ryonpk ORIGINAL_DST/209.68.27.16 -
1432305299.264     51 172.20.15.235 TCP_MISS/304 271 GET
http://www.ipchicken.com/images/green.gif ryonpk ORIGINAL_DST/209.68.27.16 -
1432305299.281     68 172.20.15.235 TCP_MISS/304 271 GET
http://www.ipchicken.com/images/ipc.gif ryonpk ORIGINAL_DST/209.68.27.16 -
1432305301.137     85 172.20.15.235 TCP_MISS/200 6488 GET
http://www.ipchicken.com/ ryonpk ORIGINAL_DST/209.68.27.16 text/html

ryonpk is the correct user passed from the helper.

On Fri, May 22, 2015 at 9:14 AM, Amos Jeffries <squid3 at treenet.co.nz> wrote:

> On 23/05/2015 12:59 a.m., Patrick wrote:
> > Thanks for looking at this, Amos.  Unfortunately, I am still seeing the
> > same result with the squid-3.5.4-20150522-r13836 daily.
> >
> > I was thinking I might just being seeing what's described at
> > http://www.squid-cache.org/Doc/config/url_rewrite_extras/ as "In
> practice,
> > a %macro expands as a dash (-) if the helper request is sent before the
> > required macro information is available to Squid."  But I guess if that
> was
> > the case I would have expected to see the dash only on the first request
> > with the subsequent requests returning the %ue value at least within the
> > ttl.  But I get just the dash on every request.
> >
>
> No, you should be getting the value from the user=X kv-pair produced by
> the helper on every request. The bug fixed by Nathan was that only the
> first was and the rest wrongly got "-".
>
> If you are getting it on absolutely all requests it would seem the
> helper is not producing user=X.
>
> Or possibly ICAP is stripping it away again by creating a new "adapted"
> request. If that is the case use the external_acl_type helper in the
> adapted_http_access checks instead of http_access.
>
> Amos
>
> _______________________________________________
> squid-users mailing list
> squid-users at lists.squid-cache.org
> http://lists.squid-cache.org/listinfo/squid-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-users/attachments/20150522/e6220552/attachment.html>


More information about the squid-users mailing list