Can't import IIS log files

Hi all,

Piwik seems to be awesome, but I was about to give up when I decided to give the forum a try.

I successfully installed Piwik version 1.12 (just downloaded from the site today) using PHP 5.3.13 and Apache 2.2 in a Windows Server 2008, but I can’t manage to import IIS Log Files. I’m using IIS 7 log files and I’m trying to use import_logs.py using Python 2.7.22 to import these files. This is the command line:


python import_logs.py --usr=http://localhost/piwik c:\temp\inetpub\logs\LogFiles\W3SVC1\u_ex130922.log 
--login=admin --password=admin --idsite=1

When I run that I see in the console window:


Parsing log c:\Temp\inetpub\logs\LogFiles\W3SVC1\u_ex130922.log...
3612 lines parsed, 0 lines recorded, 0 records/sev (avg), 0 records/sec (current)
3612 lines parsed, 0 lines recorded, 0 records/sev (avg), 0 records/sec (current)
3612 lines parsed, 0 lines recorded, 0 records/sev (avg), 0 records/sec (current)

This line repeats several times, and at the final I see an error like that:


Fatal error: <br />
<font size='1'><table class='xdebug-error xe-fatal-error' dir='ltr' border='1' c
ellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color
: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Fatal error: Maximu
m execution time of 30 seconds exceeded in C:\Desenv\wamp\www\piwik\core\Tracker
\Db\Pdo\Mysql.php on line <i>159</i></th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec
'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolo
r='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='cent
er'>0.0014</td><td bgcolor='#eeeeec' align='right'>905472</td><td bgcolor='#eeee
ec'>{main}(  )</td><td title='C:\Desenv\wamp\www\piwik\piwik.php' bgcolor='#eeee
ec'>..\piwik.php<b>:</b>0</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='cent
er'>0.0455</td><td bgcolor='#eeeeec' align='right'>4855536</td><td bgcolor='#eee
eec'>Piwik_Tracker->main(  )</td><td title='C:\Desenv\wamp\www\piwik\piwik.php'
bgcolor='#eeeeec'>..\piwik.php<b>:</b>75</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>3</td><td bgcolor='#eeeeec' align='cent
er'>29.9044</td><td bgcolor='#eeeeec' align='right'>6449312</td><td bgcolor='#ee
eeec'>Piwik_Tracker_Visit->handle(  )</td><td title='C:\Desenv\wamp\www\piwik\co
re\Tracker.php' bgcolor='#eeeeec'>..\Tracker.php<b>:</b>231</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>4</td><td bgcolor='#eeeeec' align='cent
er'>29.9935</td><td bgcolor='#eeeeec' align='right'>6461432</td><td bgcolor='#ee
eeec'>Piwik_Tracker_Action->record(  )</td><td title='C:\Desenv\wamp\www\piwik\c
ore\Tracker\Visit.php' bgcolor='#eeeeec'>..\Visit.php<b>:</b>224</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>5</td><td bgcolor='#eeeeec' align='cent
er'>29.9954</td><td bgcolor='#eeeeec' align='right'>6465744</td><td bgcolor='#ee
eeec'>Piwik_Tracker_Db_Pdo_Mysql->query(  )</td><td title='C:\Desenv\wamp\www\pi
wik\core\Tracker\Action.php' bgcolor='#eeeeec'>..\Action.php<b>:</b>730</td></tr
>
</table></font>

You can restart the import of "c:\Temp\inetpub\logs\LogFiles\W3SVC1\u_ex130922.l
og" from the point it failed by specifying --skip=4 on the command line.

I have other log files that doesn’t display the error, but write no statistic record in Piwik.

I tried to include the argument


--log-format-name=iis

But I get the error


0 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
Parsing log c:\Temp\inetpub\logs\LogFiles\W3SVC1\u_ex130922.log...
Traceback (most recent call last):
  File "import_logs.py", line 1575, in <module>
    main()
  File "import_logs.py", line 1539, in main
    parser.parse(filename)
  File "import_logs.py", line 1411, in parse
    match = format.regex.match(line)
AttributeError: 'IisFormat' object has no attribute 'regex'

Am I doing anything wrong?

For the records, this is the beginning of my log file


#Software: Microsoft Internet Information Services 7.0
#Version: 1.0
#Date: 2013-09-22 00:00:45
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status time-taken
2013-09-22 00:00:45 216.55.142.141 GET /pags/rede_credenciada.html - 80 - 177.158.44.70 Mozilla/5.0+(Windows+NT+6.1)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/29.0.1547.76+Safari/537.36 200 0 0 3057
2013-09-22 00:00:46 216.55.142.141 GET /img/TT_rede.jpg - 80 - 177.158.44.70 Mozilla/5.0+(Windows+NT+6.1)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/29.0.1547.76+Safari/537.36 200 0 0 826
2013-09-22 00:00:46 216.55.142.141 GET /pags/img/espaco_Rodape.png - 80 - 177.158.44.70 Mozilla/5.0+(Windows+NT+6.1)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/29.0.1547.76+Safari/537.36 404 0 2 967
2013-09-22 00:00:48 216.55.142.141 GET /pame/frmRedeCredenciada.aspx - 80 - 177.158.44.70 Mozilla/5.0+(Windows+NT+6.1)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/29.0.1547.76+Safari/537.36 200 0 0 2542
2013-09-22 00:00:49 216.55.142.141 GET /pame/App_Img/BT_bairro.jpg - 80 - 177.158.44.70 Mozilla/5.0+(Windows+NT+6.1)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/29.0.1547.76+Safari/537.36 200 0 0 1138
2013-09-22 00:00:49 216.55.142.141 GET /pame/App_Img/BT_especialidade.jpg - 80 - 177.158.44.70 Mozilla/5.0+(Windows+NT+6.1)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/29.0.1547.76+Safari/537.36 200 0 0 2480
2013-09-22 00:05:16 216.55.142.141 GET /img/BT_07.jpg - 80 - 95.108.158.241 Mozilla/5.0+(compatible;+YandexImages/3.0;++http://yandex.com/bots) 304 0 0 202
2013-09-22 00:05:52 216.55.142.141 POST /pame/frmRedeCredenciada.aspx - 80 - 177.158.44.70 Mozilla/5.0+(Windows+NT+6.1)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/29.0.1547.76+Safari/537.36 200 0 0 2745

Thanks,
Ricardo

see Troubleshooting - Analytics Platform - Matomo

matt, thanks for the prompt answer. It seems to be working now.