Qlik Community

QlikView Documents

Documents for QlikView related information.

How to extract information from Qlikview access log files?

Not applicable

How to extract information from Qlikview access log files?

Hi all,

Sometimes we need to retrieve access log information, to knew when and who accessed our application, CPU and RAM usage, etc;

QlikView server, dispose those information in a special directory

C:\ProgramData\QlikTech\QlikViewServer

The generated access log files are named like: Sessions_ServerName_Date.log

So by the way to extract those information you can use a routine like:

Sub readFiles (root)

  //Will check for reach root file named like "Sessions"

    For each File in filelist ('$(root)\Sessions*.log')

    vsFileCheck = index(File,'~$');

        //If File Exists

        if vsFileCheck=0 then

            //Generate a temporary table with log information

            Acessos:

  LOAD [Exe Type],

      [Exe Version],

      [Server Started],

      Timestamp,

      Document,

      [Document Timestamp],

      [QlikView User],

      [Exit Reason],

      [Session Start],

      [Session Duration],

      [CPU spent (s)],

      [Bytes Received],

      [Bytes Sent],

      Calls,

      Selections,

      [Authenticated user],

      [Identifying user],

      [Client machine identification],

      [Serial number],

      [Client Type],

      [Client Build Version],

      [Secure Protocol],

      [Tunnel Protocol],

      [Server Port],

      [Client Address],

      [Client Port],

      [Cal Type],

      [Cal Usage Count]

  FROM

            [$(File)] (txt, utf8, embedded labels, delimiter is '\t', msq);

       endif//Until there are no more log files

    Next File;

  

    //If files do not exists, a blank structure will be created

    Acessos:

  LOAD * INLINE

  [

  Exe Type,Exe Version,Server Started,Timestamp,Document,Document Timestamp,QlikView User,Exit Reason,Session Start,Session Duration,CPU spent (s),Bytes Received,Bytes Sent,Calls,Selections,Authenticated user,Identifying user,Client machine identification,Serial number,Client Type,Client Build Version,Secure Protocol,Tunnel Protocol,Server Port,Client Address,Client Port,Cal Type,Cal Usage Count

  ];

  //finally the temporary table will turned in qvd file

    store Acessos into DADOS\Acessos.qvd;

  //temp table is dropped

  drop table Acessos;

End sub;

After that call it to load all access log files

call readFiles('C:\ProgramData\QlikTech\QlikViewServer')

Labels (3)
Comments
MVP
MVP

In order to speed up loading from log files you can convert each one to a QVD and then only refresh it when the date on the CSV file changes.  Obviously, old log files will never change so you can simply load from the much faster QVD's.

I have posted a tutorial blog on how to go about doing this: http://bit.ly/1fO33Q6

Steve

How about just doing a wildcard load with Load ...FROM Sessions*.log?

And using BUFFER prefix to  to load only changed data?

-Rob

Version history
Revision #:
1 of 1
Last update:
‎04-23-2014 02:07 PM
Updated by: