Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
ajaykumar1
Creator III
Creator III

Pickup of particular string line from log file

Hi All,

The below mentioned is the Log file details in the path C:\ProgramData\QlikTech\DistributionService\1\Log.

Here am attaching the my log file.In that what i want want is i used the "Let start = now() and let end =now() functions"

I want to pick up the those lines and then i have to consider that time only.

E.g :

11/24/2014 21:05:52.3794186Information2014-11-24 21:05:52: 0005  Let start = now()

11/24/2014 21:36:20.2813389Information2014-11-24 21:36:15: 0065  Let end = now()

Note : we have N no of let functions like Let start2,let end2 etc....

I hope my requirement is clear.

More Thanks,

Ajay

1 Solution

Accepted Solutions
ashfaq_haseeb
Champion III
Champion III

Hi,

Check if this helps

Regards

ASHFAQ

View solution in original post

10 Replies
ashfaq_haseeb
Champion III
Champion III

Hi,

What is the agenda behind this?

What are you trying to achieve here?

Regards

ASHFAQ

ajaykumar1
Creator III
Creator III
Author

Thanks for quick reply.

I have existing architecture and its taking more time to reload.So initially what i want to know is where is taking more time(identifying from log files time).

I have to give the time taking for level like qvd wise.

Then am planning to some actions on this.

I hope your understand else let me know if in case anything required or please provide new inputs.

Ajay

tresesco
MVP
MVP

Try like:

Directory;

LOAD @1,

     @2,

     @3,

     @4,

     @5,

     @6,

     @7

FROM

logfile.txt

(txt, codepage is 1252, no labels, delimiter is ' ', msq) where Match(@7, 'start', 'end');

Basically, using space as separator, you would find them in the field number 7 and you can decide then how to handle (either in back-end or in front-end).

its_anandrjs
Champion III
Champion III

Hi Ajay,

If you want only Start and End time then use

LOAD

     If(@7 = 'start',@3) as Starttime,

     If(@7 = 'end',@3) as Endtime

FROM

logfile.txt

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

Regards

Anand

ashfaq_haseeb
Champion III
Champion III

Hi,

Check if this helps

Regards

ASHFAQ

ajaykumar1
Creator III
Creator III
Author

Thanks Anand.Could you please explain how @7 and @3 is working.

Ajay

ajaykumar1
Creator III
Creator III
Author

Got it understood.

ajaykumar1
Creator III
Creator III
Author

Thanks Ashfaq,Tresecco and Anand.

All the solutions are working fine.But i can make only one as correct 🙂

Thanks,

Ajay

its_anandrjs
Champion III
Champion III

Hi,

The log file is tab dilimiter file and when we load this file there is no column label given then we load it with name

Load

@1,

@2,

@3,

..

And finally we load it like

LOAD

     If(@7 = 'start',Left(@3,len(@3)-1)) as Starttime,

     If(@7 = 'end',Left(@3,len(@3)-1)) as Endtime,

FROM

logfile.txt

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

And in front end use formula if you need time difference

'Time Diff '&interval(Starttime - Endtime ,'hh:mm:ss')

Regards

Anand