Thanks for the info Willy.

Is this a layer 6 capture? If yes, do I need to do something special to log
it?

The following snippet logs just a '-'

  capture request header Host len 40
  capture request header Via len 100
  capture request header xyz len 52
  http-request capture req.payload(0,0) len 4000

In log format :-

hdump=%[capture.req.hdr(3)]



On Wed, Sep 14, 2016 at 12:13 AM, Willy Tarreau <w...@1wt.eu> wrote:

> Hi,
>
> On Tue, Sep 13, 2016 at 02:10:50PM -0700, Manas Gupta wrote:
> > Thanks for the pointer.
> >
> > I need to log the values of these headers as well. Any suggestions on how
> > to do that?
> >
> > On Tue, Sep 13, 2016 at 1:28 PM, Pavlos Parissis <
> pavlos.paris...@gmail.com>
> > wrote:
> >
> > > On 13/09/2016 09:58 ????, Manas Gupta wrote:
> > > > Hi,
> > > > I am familiar with capturing individual HTTP headers in HAProxy 1.6.x
> > > > (http://blog.haproxy.com/2015/10/14/whats-new-in-haproxy-1-6/). This
> > > requires the
> > > > header to be explicitly stated in the cfg
> > > >
> > > > For example to capture the via header -
> > > > capture request header Via len 100
> > > >
> > > > And then log via - %[capture.req.hdr(0)]
> > > >
> > >
> > > Use the following to get all headers without their value:
> > >
> > > %[req.hdr_names(:)]
>
> I've been in need for this from time to time, especially during debugging
> sessions. I think Thierry managed to do it, maybe he did is using Lua, I
> don't remember. Now reading the documentation, I'm seeing that
> req.payload(0,0) should report the whole buffer. This could be very close
> to what you need, as for most requests it will contain exactly the whole
> request. For POST requests it may contain a part of the body, and for
> pipelined requests you may find the next requests. But overall it's not
> that bad.
>
> Cheers,
> Willy
>
>

Reply via email to