Hello Philip On 7/6/2015 9:47 PM, Phillip Decker wrote: > Hello again all, > > I have a configuration problem, and I have a workaround that I don't > like, so I'm hoping someone here might have a better solution - > > I have a number of capture fields such as ssl_c_s_dn, request header > referrer, request header X-Forwarded-For, etc that get logged using %hr, > among another 12 or so fields such as %t, %H, %B, %ci and so on. > > The problem is the client has an established log format which goes to an > enterprise centralized log db. I'd love to be able to write out this > format directly with haproxy, but since all the captured fields in > haproxy get appended together by %hr and %hs, I don't know of a way to > put one captured field in spot #4 of a log line, and then another > captured field in spot #7, etc. > > In order to work around this, I have haproxy instead outputting all this > data to an "intermediate" log format, and then have another process > running which picks these up and rearranges them into the arbitrary log > format that the enterprise accepts.
Well, it seems like you are looking to reorder the captures, so take a look at: http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#7.3.6-capture.req.hdr You can use this in your log format to specify a different ordering than the one how the captures are sorted in the config. In 1.6 you could also use: http://cbonte.github.io/haproxy-dconv/configuration-1.6.html#declare%20capture Let me know if this helps. Regards, Nenad

