Hi.

Am 08-09-2016 21:16, schrieb Benoit GEORGELIN - Association Web4all:
Hello members of the list,

I was wondering if Haproxy custom log could log the same things as apache log format does ?

Well due to the fact that we don't know your apache log format I assume you mean CLF (common log format) ;-).
http://httpd.apache.org/docs/2.4/mod/mod_log_config.html

I also not know which version of haproxy you use so I refer to the latest stable one.

There is a predefined crf format in haproxy which is documented here

http://cbonte.github.io/haproxy-dconv/1.6/configuration.html#8.2
http://cbonte.github.io/haproxy-dconv/1.6/configuration.html#8.2.4

Haproxy is on the top for HTTP servers farms and I would like to stop logging on the HTTP servers side (apache or ngnix) and consume the log made by Haproxy with everything I get from a typical Apache log

I think, at that time, Haproxy does not log everything like apache will do, but maybe it's something than can be changed ?

HAProxy is able to log much more the apache ;-).

You will need to add some lines like these to get the additional information from the request.

##
     # log the beginning of the referrer
     capture request  header Referer len 20
     capture request  header User-agent len 20
##

As described here.
http://cbonte.github.io/haproxy-dconv/1.6/configuration.html#8.8

That would be nice and will save a lot of time/ressources
In my case, this is what i'm doing :

- Haproxy
Loadblance to 5 HTTP servers
Apache2 custom log with X-Forwarder-for

- Apache2
Each HTTP serveur runs apache2 and log http requests locally to access_domain_log

Every night, merging of the log and then process the full log with Http log analyser like Awstats

Before you can feed Awstats with the new logs you will need to pre-process it.

Maybe the halog tool ( http://git.haproxy.org/?p=haproxy-1.6.git;a=tree;f=contrib/halog;h=189001c583ddcf3e35060171a58c39fd5115b9c2;hb=HEAD ) can help.

There is also a doc for this tool.
https://www.haproxy.com/static/media/uploads/eng/resources/appnotes_0054_analyze_haproxy_logs_with_halog_en.pdf

Store the logs to a dedicated storage for archiving

If I could get the same HTTP information directly from Haproxy log , this will same us a lot of time an ressource usage.

Haproxy logs -> log shipper -> elasticsearch /hadoop -> kibana or something else to display log information

Thanks for your help

Cordialement,

BenoƮt G

Best regards
Aleks

Reply via email to