Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Log Apache analysis with QlikView

I have to analyze a log file of a portal and would like to use as a tool ClikView. The file has the extension. Log

The format of the log is to Apache and I should extract the information contained in it.

A sample of the file is as follows:


61432c789518088e2c708f122d260f9178b87059 - - [04/Mar/2014:06:25:04 +0100] "GET /page/Stig_Boqvist HTTP/1.1" 200 4561 "-" "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)"

445fd14a49ff5469ed4ee51f5a2b6a7f5efea22b - - [04/Mar/2014:06:25:05 +0100] "GET /data/Waldkirchen.jrdf HTTP/1.1" 200 8612 "-" "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)"

949d8c5d984bdbb6ca32364d80a4e2469e8a8e25 - - [04/Mar/2014:06:25:06 +0100] "GET /page/Homer_Dickenson HTTP/1.1" 200 4533 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"

....

The information I want to know are:

- Content displayed more

- User agent used to make requests etc.

Basically I should be doing the business intelligence analysis on this log file. Can you help me or give me some suggestions?You can read the contents of the file and parse it directly? Taking for example the dashboard?

Thank you in advance for your reply

greetings

Carlo

Tags (2)
1 Solution

Accepted Solutions
Employee
Employee

Re: Re: Re: Re: Log Apache analysis with QlikView

I´ve used this script

SET ThousandSep='.';

SET DecimalSep=',';

SET MoneyThousandSep='.';

SET MoneyDecimalSep=',';

SET MoneyFormat='R$ #.##0,00;-R$ #.##0,00';

SET TimeFormat='hh:mm:ss';

SET DateFormat='DD/MM/YYYY';

SET TimestampFormat='DD/MM/YYYY hh:mm:ss[.fff]';

SET MonthNames='jan;fev;mar;abr;mai;jun;jul;ago;set;out;nov;dez';

SET DayNames='seg;ter;qua;qui;sex;sáb;dom';

LOAD @1 as IP,

    date#(lower(mid(@4,2,11)),'DD/MMM/YYYY') as Date,

    mid(@4,14,11) as Hour,

    @5,

    @6 as Richiesta,

    @7 as Risposta,

    @8 as Payload,

    @9,

    @10 as UserAgent

FROM

[provalog.txt]

(txt, codepage is 1252, no labels, delimiter is spaces, msq);

13 Replies

Re: Log Apache analysis with QlikView

Please don't post the same question twice.


talk is cheap, supply exceeds demand
Not applicable

Re: Log Apache analysis with QlikView

I'm sorry I was wrong. I'm new in the community.

Not applicable

Re: Log Apache analysis with QlikView

I would try Fixed Record , see imagelog1.jpg

Employee
Employee

Re: Log Apache analysis with QlikView

Use Fixed record in order to split your lines

Not applicable

Re: Log Apache analysis with QlikView

Thanks for the reply Cleaver now trying to do fixed record
Thanks for the support.


Carlo

Not applicable

Re: Log Apache analysis with QlikView

Thanks for the reply with graphic Amir. You have been very kind, now I try with fixed record.


Carlo



Not applicable

Re: Log Apache analysis with QlikView

Hi Amir,

I tried to record fixed but the size of the get is not the same for all requests and get cutting losing information:

problema.JPG.jpg


To solve this problem I tried with delimited and I chose the space as a delimiter but then so I can not separate the date in day, month, year, as the format is day / month / year and does not include spaces.


prova.JPG.jpg

Any suggestions? How do I separate the date in day, month, year, and at the same time do not get cut off the leaking information? I would need a fusion between record fixed and delimited

thanks
Carlo

Employee
Employee

Re: Log Apache analysis with QlikView

Could you post a sample of your log?

I´ll make it for you

Not applicable

Re: Re: Log Apache analysis with QlikView

I am attaching the file to upload with QlikView. The tables at the end I would get are:

IP-address
day-
month-
-year
-now
user-agent
-request
payload-size
-server response

I would like to get something like the following figure, however, in addition to the tables of the day, month, year, hour

schema_tabella.JPG.jpg


Thank you very much, I'm grateful for the response

Community Browser