<p dir="ltr">Thanks Thomas.</p>
<div class="gmail_quote">On May 2, 2016 11:22 AM, "Thomas Lecomte" <<a href="mailto:thomas.lecomte@virtual-expo.com">thomas.lecomte@virtual-expo.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, May 2, 2016 at 7:00 AM, Debraj Manna <<a href="mailto:subharaj.manna@gmail.com">subharaj.manna@gmail.com</a>> wrote:<br>
> Thanks Thomas.<br>
><br>
> How can I maintain a counter per url. In vcl_deliver obj.hits will again<br>
> give me the overall hits.<br>
<br>
As I said, you have to implement this yourself using VCL and varnishncsa.<br>
<br>
Example of VCL:<br>
<br>
# 38. match rule for PDF pages<br>
if (req.url ~ "^\/pdf\/([^\/]+)\-(\d+)\.html$")<br>
{<br>
set req.http.X-MatchRule = "38";<br>
return (hash);<br>
}<br>
[...]<br>
std.log("MR:" + req.http.X-MatchRule);<br>
<br>
Then, call varnishncsa with -F and %{VCL_Log:MR} plus<br>
%{Varnish:handling} to log the match rule and the handling of the<br>
request (miss, hit, pipe, pass, whatever). You will have to parse this<br>
output yourself to compute a ratio.<br>
<br>
--<br>
Thomas Lecomte / Virtual Expo<br>
</blockquote></div>