2

running varnishd (varnish-4.1.0 revision 3041728), and logging using

varnishlog -q "BerespStatus >= 500"

I would like to know, if is possible to print POST content. There is XML-RPC service running on server and sometime it returns 500. In log is nothing, so I would like to know, which XMLRPC method is problematic.

Any suggestions ?

1 Answer 1

0

Varnish (and hence varnishlog & varnishncsa) doesn't give you access to the http body in either the request or the response. Therefore, this isn't possible using vanilla varnish.

Having said that, it is possible to insert inline C code into your VCL. Therefore, technically you could access the POST data using some custom C code and use std.log to write the bits you care about to the logs.

It looks like there are some existing VMODs out there which access the POST data (eg vmod_bodyaccess), but you'd likely need to do more parsing than that to get the XML-RPC method out.

Disclaimer: I wouldn't recommend going anywhere near inline C unless you really know what you're doing. Also, I've not tried any VMODs mentioned here, so can't tell how appropriate they are.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .