Can't setup Apache CustomLog to directly import in Piwik


#1

I configured apache just like this article (https://github.com/piwik/piwik/tree/master/misc/log-analytics#setup-apache-customlog-that-directly-imports-in-piwik) explains but nothing happens during apache execution and while I visit the monitored website.

Virtualhost config:


LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" format_piwik
       CustomLog "|/var/www/piwik/misc/log-analytics/import_logs.py --url=https://estatisticas.dsv.sistemas.intranet.example.com --idsite=1 --output=/tmp/piwik.log -" format_piwik

I am using Piwik 2.11.1 , Apache 2.2.22 and Debian wheezy.

Piwik script prints out the following text to /tmp/piwik.log only when I start apache. Then nothing is printed to piwik’s log file during apache execution and while I visit the monitored website:


Performance summary
-------------------

    Total time: 0 seconds
    Requests imported per second: 0.0 requests per second

0 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
0 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
Parsing log (stdin)...

Logs import summary
-------------------

    0 requests imported successfully
    0 requests were downloads
    0 requests ignored:
        0 HTTP errors
        0 HTTP redirects
        0 invalid log lines
        0 requests did not match any known site
        0 requests did not match any --hostname
        0 requests done by bots, search engines...
        0 requests to static resources (css, js, images, ico, ttf...)
        0 requests to file downloads did not match any --download-extensions

Website import summary
----------------------

    0 requests imported to 1 sites
        1 sites already existed
        0 sites were created:

    0 distinct hostnames did not match any existing site:

What is wrong?


(Matthieu Aubry) #2

Hi there

Sorry I cant directly help about this - it’s possible the documentation has mistakes as it was proposed by community members - we didn’t actually test it. if you find the cause of the bug, please submit improvement to the README file via pull request :slight_smile: all the best!