Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Como recuperar informações dos logs de acesso no Qlikview?

Olá pessoal,

Ás vezes precisamos recuperar as informações do log de acessos das nossas aplicações Qlikview. Tive necessidades que vão desde os usuários que acessam a aplicação ao consumo de CPU e memória

O QlikView server, retorna as informações de log no seguinte diretório

C:\ProgramData\QlikTech\QlikViewServer

A nomenclatura desses arquivos segue o padrão : Sessions_NomeDoServidor_Data.log

Então para extrair essas informações utilizo a seguinte rotina:

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, an 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;

Depois chamo-a, apontando para o diretório de logs e tenho meu QVD gerado com toda a informação necessária    

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

Espero que seja útil a vocês

Labels (2)
1 Reply
Not applicable
Author

Cara muito interessante.

obrigado.