import_logs.py extend the list of file extensions to track as "Downloads"


#1

hello

I use the import_logs.py script for import apache2 log files in piwik. Now I want to change the list of file extensions to track as “Downloads”. The file import_logs.py has a variable DOWNLOAD_EXTENSIONS with all file extensions like:


DOWNLOAD_EXTENSIONS = (
    '7z aac arc arj asf asx avi bin csv deb dmg doc exe flv gz gzip hqx '
    'jar mpg mp2 mp3 mp4 mpeg mov movie msi msp odb odf odg odp '
    'ods odt ogg ogv pdf phps ppt qt qtm ra ram rar rpm sea sit tar tbz '
    'bz2 tbz tgz torrent txt wav wma wmv wpd xls xml z zip'
).split()

Can I extends this list without get problems by the next update of piwik? Exists a other proper way to extend this list?


(Matthieu Aubry) #2

which extension would you like to add?


#3

hello matt

I will add the xml schema file extention: xsd


(Matthieu Aubry) #4

Added in Adding .xsd extension to file list, suggested in forum http://forum.p… · matomo-org/matomo@582f38f · GitHub


#5

I was wondering on why the files with extensions listed in DOWNLOAD_EXTENSIONS do not show up under Actions > Downloads? Is there something additional I have to add when running the import script?

Thanks!


(Matthieu Aubry) #6

have you set --enable-static ?

It should work and they should appear in downloads.


#7

yes, this is the line i am using

python /var/www/piwik/misc/log-analytics/import_logs.py --url=http://mypiwiksite.com /var/www/html/sitename/www/logs/access.old --idsite=4 --recorders=2 --enable-http-errors --enable-http-redirects --enable-static


(Matthieu Aubry) #8

can you post a short log file that can be used to reproduce the issue ? (eg. one or two lines that are not imported and you expected them to be)


#9

just changed the folder and file names (not extension), but everything else is the same.

173.14.169.177 - - [07/May/2010:10:18:08 -0400] "GET /foldername/filename.pdf HTTP/1.1" 200 79056 "http://wl.peer360.com/b/H8CMDeQljZI5R8T9pQo4/survey.asp?h=-1" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB6.4; .NET CLR 2.0.50727)"

205.216.152.2 - - [01/Jun/2010:15:55:01 -0400] "GET /foldername/filename.pdf HTTP/1.1" 200 81447 "http://wl.peer360.com/b/FaYk288i1annS3070oXt/survey.asp?h=-1" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"


(Matthieu Aubry) #10

Thank you for the report! I could reproduce it, and have created a ticket in our issue tracker: Importing a log file with only PDF files does not import data · Issue #5286 · matomo-org/matomo · GitHub


#11

Thank you.