<div dir="ltr">Hi Dridi / Team,<div><br></div><div>Gentle reminder..</div><div><br></div><div>Thank you</div><div>Hardik</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 4 Apr 2019 at 11:33, Hardik <<a href="mailto:hetardik.p@gmail.com">hetardik.p@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Thanks Dridi.<div><br></div><div>I was ill and off work for few days so did not reply.</div><div><br></div><div>Hey Dridi, I am already using varnishncsa. And use case perspective I am much familiar. I am using below configuration for varnishncsa. This logs I am calling as raw-logs/Apache and providing to customer directly without any modification.Means no processing on this.</div><div><br></div><div><div>#the format of the log lines</div><div>FORMAT='-F "%h %v %u %t \"%m %U%q %H\" %s %O \"%{Referer}i\" \"%{User-agent}i\" %S [%{VCL_Log:x-product}x lg=\"%{Accept-Language}i\" fwd=\"%{X-Forwarded-For}i\" %{VCL_Log:namespace}x %{VCL_Log:x-cache-hit}x/%{VCL_Log:x-revalidate-cache}x %{VCL_Log:sc-substatus}x]</div></div><div><br></div><div>Note- few parameter I have added in varnishncsa to get that information  ex:%S.</div><div><br></div><div>I have written other utility because want to parse all the fields based on billing requirements. I have tried removing "-g session" option and now log loss reduced a lot(I can say 95%). </div><div><br></div><div>If you can help on my previous reply/doubts then will be really helpful ( because billing really difficult to change billing setup).I am only facing two issues here, 1. log loss 2. missing of ReqAcct ( which is also case in varnishncsa).</div><div><br></div><div>If I am doing something wrong other then "-g session" option in the code I have pasted before from utility please point out.</div><div><br></div><div>Thank you<br>Hardik</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 20 Mar 2019 at 21:02, Dridi Boukelmoune <dridi@varni.sh> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, Mar 20, 2019 at 10:40 AM Hardik <<a href="mailto:hetardik.p@gmail.com" target="_blank">hetardik.p@gmail.com</a>> wrote:<br>
><br>
> Hi Dridi,<br>
><br>
> Do you need all timestamps or a specific metric?<br>
> Regarding timestamp, want to read two tags,<br>
> Timestamp      Start: 1516269224.184112 0.000000 0.000000<br>
> Timestamp      Resp: 1516269224.184920 0.000808 0.000087<br>
><br>
> Do you need the BereqAcct records for all transactions? Including cache hits?<br>
> Sorry it is my mistake. I am not reading any of the beck-end records. So can ignore BereqAcct.<br>
> I need fields from Req records only.<br>
<br>
Ok, in this case you can probably get away with just varnishncsa to<br>
collect all you need.<br>
<br>
No grouping (the default -g vxid), client mode (-c) only, with a<br>
custom -F format to grab only what you need.<br>
<br>
This should help reduce the churn to the point where you lose data.<br>
<br>
If you struggle with this, I can help you later with that, but start<br>
by reading the following manuals:<br>
<br>
- varnishncsa<br>
- vsl<br>
- vsl-query<br>
<br>
For example, the format for the timestamps you wish to collect would<br>
look like this:<br>
<br>
> %{VSL:Timestamp:Start[1]}x %{VSL:Timestamp:Resp[2]}x %{VSL:Timestamp:Resp[3]}x<br>
<br>
Rinse and repeat for all the things you need to capture for the logs,<br>
put them in the order you prefer and off you go. No need to write your<br>
own utility.<br>
<br>
> What does FD mean here? File descriptor? From ReqStart?<br>
> Yes, Its file descriptor. And yes reading from ReqStart till ReqAcct. Using switch case to read needed records.<br>
<br>
If you already work with VXIDs, the FD becomes redundant.<br>
<br>
<br>
<br>
Dridi<br>
</blockquote></div>
</blockquote></div>