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')