1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
[RADIO LOGS] Help & Explanations
The logs can be automatically transferred via FTP and then be processed (note, the operation requires solid programming skills)
Actions to perform
Login to the management interface
Under your radio, click Settings and enable the transfer of logs
Enter information about the desired destination
The system tests whether or not the server configuration entered and the write permissions are OK
Find out more
The logs for your radio will be provided in the form of a zipped file xyz.mp3-20140805.log.gz (the date of the log is in the YYYYMMDD format).
Each log begins at 4:00 a.m. Swiss time and ends at 3:59:59 a.m. the following day.
The log is in the form ip user-identifier authuser [date-time] "request" status bytes "referer" "useragent" listening-time:
<code>81.56.215.98 - - [09/Apr/2009:08:23:18 +0200] "GET /toto.mp3 HTTP/1.1" 200 1211297 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.8) Gecko/2009032711 Ubuntu/8.10 (intrepid) Firefox/3.0.8" 69</code>The best thing is to use a regular expression like the one below:
<code>"/^(\S+)\s(.+)\s(\S+)?\s\[((\d\d)\/([a-zA-Z]{3,3})\/(\d\d\d\d)\:(\d\d)\:(\d\d)\:(\d\d)\s\+\d\d\d\d)\]\s"GET\s\/([\-a-z0-9]{1,40}(\.)?(mp3|aac|ogg){0,1})(.*)?"\s(\d{3,3})\s(\d+)\s"(.+)"\s"(.+)"\s(\d+)$/i";</code>The syntax is is that of the function PHP preg_match and should be adapted if other functions/languages are used.
Preg_match gives a table with the following significant positions:
1: ip
4 date - time complet
5: day
6: month
7: year
8: hour
9: min
10: seconds
11: mount name
15: result (HTTP code)
16: length in bytes
18: user agent
19: playing time (seconds)
It may happen that the log line is malformed, because a referer is too long, for example. This Icecast behavior can not be corrected. In this case, the regexp does not extract anything and the information cannot be used because it is incomplete. So you must ignore the line.
The IP addresses of the row 84.16.67.128/25 should be ignored because these are the streaming servers.