404 status code

Hi all,

I am new to piwik. I am interested to import web server logs into piwik db. I used the pyhton script provided in the misc dir as suggested in the docs, i.e.


python2 /var/www/localhost/htdocs/piwik/misc/log-analytics/import_logs.py --url=http://localhost/piwik/ --idsite=1 --recorders=2 --enable-http-errors --enable-http-redirects --enable-static --enable-bots /tmp/access.log

the access.log file contains just 8 lines with different http status code


localhost - - [05/Mar/2015:19:54:00 +0100] "GET /awstatsQM/view/test.php HTTP/1.1" 200 1224
localhost - - [05/Mar/2015:19:54:00 +0100] "GET /awstatsQM/view/css/bootstrap.min.css HTTP/1.1" 404 293
localhost - - [05/Mar/2015:19:54:00 +0100] "GET /awstatsQM/view/css/font-awesome.min.css HTTP/1.1" 404 296
localhost - - [06/Mar/2015:08:07:28 +0100] "GET /awstatsQM/fonts/fontawesome/fontawesome-webfont.woff?v=4.2.0 HTTP/1.1" 200 83760
localhost - - [06/Mar/2015:08:17:36 +0100] "GET /awstatsQM/js/ie10-viewport-bug-workaround.js HTTP/1.1" 304 -
localhost - - [06/Mar/2015:08:18:36 +0100] "GET /awstatsQM/view/test.php HTTP/1.1" 200 7381
localhost - - [06/Mar/2015:08:18:36 +0100] "GET /awstatsQM/css/bootstrap.min.css HTTP/1.1" 304 -
localhost - - [06/Mar/2015:08:18:36 +0100] "GET /awstatsQM/css/font-awesome.min.css HTTP/1.1" 304 -

The data were correctly imported into the db but when I look into the report I have:

Action->Pages: 2 page view (Correct)
Action->Download: 6 unique download (!!!)
This is very strange because all the download (.css, .js, .woff) failed as reported in the access.log file with 404 or 304 status code.

What is wrong here? Am I misunderstood something?

TIA

Maurizio

Hi there, you used --enable-http-errors --enable-http-redirects so it will track the errors and redirects HTTP requests

Hi Matt,
thanks for the response. I execute import_logs.py with options --enable-http-errors --enable-http-redirects because i wanted http errors and redirects appear on piwik dashboard. The problem is that there is no tag/flag or whatever in the dashboard that identifies 404 and 30x hits as such. The logs that I included on my previous messages are:

2 correct requests for html pages (code 200)
6 request for other pages (css, woff files): 5 with 404 or 304 status code and 1 with 200 status code

therefore I would expected in the dashboard->Action->Download something like:

1 download (the one with http status code 200)
2 404 requests
3 304 requests

but piwik show me 6 downloads as they were all with status code 200 without any option to identify correct download and failed download requests. Is it possible to have such a distinction on piwik (like for instance one can have on awstats)?

I hope my question is now more clear.

Best regards

Maurizio

The problem is that there is no tag/flag or whatever in the dashboard that identifies 404 and 30x hits as such.

there is a small difference between those requests, errors/redirects have a custom variable set. you can see it in: http://demo-log-analytics.piwik.org/index.php?module=CoreHome&action=index&date=yesterday&period=day&idSite=2#/module=CustomVariables&action=menuGetCustomVariables&date=yesterday&period=day&idSite=2