NowWAP Statistics Reports

Posted by on May 10, 2011 in Support Blog

Topic Keywords:

The log files created by NowWAP are of a text format that follows the common log format for web servers.

These log files are stored on the NowWAP server, with one log file created for each day, using a file naming convention of WAPGW-yyyymmdd.LOG, where yyyymmdd is the 4-digit year, 2-digit month and 2-digit day.

NowWAP 2011 has optional functionality which can convert these log files into a database format for further analysis. This functionality is enabled by checking “Generate Usage Reports” on the “Reports” page of the configuration dialog.

When usage reports are enabled, NowWAP will automatically generate daily and monthly usage reports.

These reports are located in the REPORTS subdirectory of the NowSMS installation.

REPORTS\LOGDB contains SQLite format databases with one database per month.

REPORTS\TEXT contains text format summary reports of NowWAP usage. Daily reports have file names of YYYYMMDD.TXT and monthly reports have file names of YYYYMM.TXT. Every night at midnight, a new daily report and updated monthly report for the current month will be generated.

The format of the text report will be similar to the following:

NowWAP Usage Report: YYYYMMDD

#### - Max Active Users

#### - Max Active Requests

#### - Total Unique MSISDN

#### - Total Sessions

#### - Total Requests



Top Active Users

#### - Phone Number 1

#### - Phone Number 2

etc...



Top Content Domains

#### - Domain 1

#### - Domain 2

etc...



Top Content Servers

#### - Server 1

#### - Server 2

etc...

REPORTS\XML contains XML formatted summary reports of NowWAP usage. Daily reports have file names of YYYYMMDD.XML and monthly reports have file names of YYYYMM.XML. Every night at midnight, a new daily report and updated monthly report for the current month will be generated.

The format of the XML report will be similar to the following. Note that some XML elements may not be present, depending on NowWAP configuration issues. Also note that additional XML elements may be added in future releases.

<NowWAPUsageReport>

<ReportDate>YYYYMMDD</ReportDate>

<MaxActiveUsers>####</MaxActiveUsers>

<MaxActiveRequests>####</MaxActiveRequests>

<TotalUniqueMsisdn>####</TotalUniqueMsidn>

<TotalSessions>####</TotalSessions>

<TotalRequests>####</TotalRequests>

<TopActiveMsisdn>

<Name>Phone Number 1</Name><Requests>####</Requests>

<Name>Phone Number 2</Name><Requests>####</Requests>

</TopActiveMsisdn>

<TopContentDomains>

<Name>Domain 1</Name><Requests>####</Requests>

<Name>Domain 2</Name><Requests>####</Requests>

</TopContentDomains>

<TopContentServers>

<Name>Server 1</Name><Requests>####</Requests>

<Name>Server 2</Name><Requests>####</Requests>

</TopContentServers>

</NowWAPUsageReport>

ReportDate – YYYYMMDD for a daily report or YYYYMM for a monthly report.

MaxActiveUsers – The maximum number of active (concurrent) users recorded during the report period. (Note: This information cannot be obtained from log files created by earlier versions of NowWAP.)

MaxActiveRequests – The maximum number of simultaneous requests recorded during the report period. (Note: This information cannot be obtained from log files created by earlier versions of NowWAP.)

TotalUniqueMsisdn – The number of unique MSISDN (phone numbers) that made requests of the proxy. (Note: Requires MSISDN/RADIUS integration.)

TotalSessions – The number of user sessions during the report period.

TotalRequests – The number of user requests serviced during the report period.

TopActiveMsisdn – A list of the most active mobile terminals and the number of requests generated by that mobile terminal during the report period. (Note: Requires MSISDN/RADIUS integration.)

TopContentDomains – A list of the content domains which recorded the most requests (hits) during the report period.

TopContentServers – A list of the content servers which recorded the most requests (hits) during the report period.

Additional Reports

It may be possible to create additional reports by developing your own queries of the reports database.

Every day the log files from the previous day get merged into a monthly SQLite database format that is stored in the REPORTS\LOGDB directory.

It is possible to download SQLite from www.sqlite.org, and use sqlite3.exe to run queries against the database.

To better understand the database structure, here are the commands that are used to create the monthly database:

CREATE TABLE WAPGWLOG (AUTOID INTEGER PRIMARY KEY AUTOINCREMENT, RequestID text, RequestIP text, MSISDN text, RequestDate text, RequestTime text, RequestType text, RequestServer text, RequestDomain text, RequestURL text, HTTPStatus text, BytesOut integer, BytesIn integer, UserAgent text);
create index RequestID on WAPGWLOG (RequestID);
create index RequestDate on WAPGWLOG (RequestDate);
create index MSISDN on WAPGWLOG (MSISDN);
create index RequestDomain on WAPGWLOG (RequestDomain);
create index RequestServer on WAPGWLOG (RequestServer);
create index RequestType on WAPGWLOG (RequestType);
create index MSISDNByDate on WAPGWLOG (RequestDate,MSISDN);
create index RequestDomainByDate on WAPGWLOG (RequestDate,RequestDomain);
create index RequestServerByDate on WAPGWLOG (RequestDate,RequestServer);
create index RequestTypeByDate on WAPGWLOG (RequestDate,RequestType);

More information about database fields:

RequestID = auto generated ID for request
RequestIP = IP address of device
MSISDN = MSISDN of device
RequestDate format = YYYYMMDD
RequestTime format = HHMMSS
RequestType – GET, POST, CONNECT, DISCONNECT, STARTSERVICE, STOPSERVICE
RequestServer – Host name part of URL
RequestDomain – Host name parsed to higher level domain name
HTTPStatus – HTTP Status code of request (e.g, 200=OK, 301=Redirect, 304=Not Modified, 404=Not Found, etc.)
BytesOut, BytesIn – Number of bytes transferred to/from device
UserAgent – User-agent header from device making request

SQL Commands used to generate information in summary report:

Total Unique MSISDN

select count(*) from (select MSISDN from WAPGWLOG where (RequestDate = ‘%s’) and (MSISDN != ”) group by MSISDN);

Total Sessions

select count(*) from WAPGWLOG where (RequestDate = ‘%s’) and (RequestType = ‘CONNECT’) and (RequestURL = ”);

Total Requests

select count(*) from WAPGWLOG where (RequestDate = ‘%s’) and (RequestType != ‘STARTSERVICE’) and (RequestType != ‘STOPSERVICE’);

Top Active Users

select MSISDN,count(*) from WAPGWLOG where (RequestDate = ‘%s’) and (MSISDN != ”) group by MSISDN order by count(*) DESC limit 100;

Top Content Domains

select RequestDomain,count(*) from WAPGWLOG where (RequestDate = ‘%s’) and (RequestDomain != ”) group by RequestDomain order by count(*) DESC limit 100;

Top Content Servers

select RequestServer,count(*) from WAPGWLOG where (RequestDate = ‘%s’) and (RequestServer != ”) group by RequestServer order by count(*) DESC limit 100;

For comments and further discussion, please click here to visit the NowSMS Technical Forums (Discussion Board)...