Sample Header Ad - 728x90

How to split varnishncsa logs into separate under systemd (Ubuntu 16.04)

0 votes
1 answer
765 views
I need to have varnishncsa split logs to separate files based on vhost. I know I can make an override configuration in /etc/systemd/system/varnishncsa.service.d that will filter on a specific vhost. Something like this somedomain.conf: [Service] RuntimeDirectory=varnishncsa Type=forking User=varnishlog Group=varnish ExecStart= ExecStart=/usr/bin/varnishncsa -q "ReqHeader ~ '^Host: somedomain.com'" -D -a -w /var/log/varnish/somedomain.log -P /run/varnishncsa/varnishncsa.pid -F '%%{X-Forwarded-For}i %%l %%u %%t "%%r" %%s %%b "%%{Referer}i" "%%{User-agent}i"' ExecReload=/bin/kill -HUP $MAINPID PrivateDevices=true PrivateNetwork=true PrivateTmp=true ProtectHome=true ProtectSystem=full PIDFile=/run/varnishncsa/varnishncsa.pid But how can i make it generate a separate log file for each of many vhosts? I want to feed these per domain logs into awstats.
Asked by user978388 (3 rep)
Aug 18, 2018, 09:54 AM
Last activity: Aug 19, 2018, 04:35 AM