Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
AC187
Contributor II
Contributor II

Logs generated in qlikview 12.40 cannot be read

Hi all,

we have a application in qlikview where we read data from logs generated from several other applications.

while we were on qlikview 11.2 the logs were read properly with encoding type as below.

load @1:10,@12:20,@37:n

from a\b\c\abc.qvw.log (fix,unicode)

 

however since after we are testing on qlikview12.40 the data is not read with same encoding configurations.

we tried with encoding (fix,utf8) and (fix,codepage is 1252) but in both cases we have numbers fetched incorrectly in the fields.

 

we also tried generating the log files in utf-8 and then setting encoding from section to (fix,utf8) but no luck.

 

can someone help on how to load  and read the document log files in qlikview 12.40?

Labels (1)
6 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

On my machine, I'm successful reading 12.40 logs as utf8.  However I do find a mix of encoding between versions and I think sometimes between customers.  In the Script Log Analyzer, I use this bit of conditional script to read one row from the log to determine the encoding for that file. 

// Determine the character encoding of the logfile by reading the first few bytes.
// QV11.2 is writing logs in unicode.
FOR EACH vEncoding IN 'utf8', 'unicode', 'codepage is 1252';
TempCode:
FIRST 1 // Log first row
LOAD IsNum(left(@1:n,1)) as X // Test first char. Set to true if it's a number.
FROM
[$(_logpath)]
(
fix, $(vEncoding))
WHERE RecNo()>1
// Skip rec 1, which causes problems if it has a BOM (Byte Order Marker)
;
EXIT FOR WHEN peek('X'); // If a number, assume we have the right encoding.
NEXT vEncoding;

At the end of the loop vEncoding contains the right encoding which can be used in a subsequent statement to read the entire file.

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

AC187
Contributor II
Contributor II
Author

Hi Rob,

i tried separately with each type.

(fix,unicode) nothing returned

(fix,codepage is 1252)

(fix,utf8) values returned but were incorrect , i mean the date which i tried to pick @1:10 from log should ideally pick only date i.e execution date but 3 values were picked with broken dates.

1 value : -09-2019

2 value : -2019

3 value : 24-09-2019 

other than the the other sub strings which i picked from log used to be correct in 11.2 version but were broken in 12.40

eg qlikview 11.2  had field (@27:n) picked correctly but are picked incorrectly in 12.40.

 

AC187
Contributor II
Contributor II
Author

I just ran and checked the above script.

only replaced my path in above scipt.

end result is x field with value 0

when tried to debug, it returned below result:

Tempcode << abc.qvw 1 line fetched

Tempcode << abc.qvw 2 lines fetched

Tempcode << abc.qvw 3 lines fetched

 

and the end result was field X with value 0 on front end.

 

 

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Question would be what is the value of vEncoding at the end of your loop?

The 3rd date looks correct to me, but the first 2 look like an offset is wrong. Can you post (attach) one of the log files?

-Rob

Brett_Bleess
Former Employee
Former Employee

Check out the following link to the Governance Dashboard area, and and pull the latest QVW for that and have a look at the script in there, that should help you confirm how Tyler has done things, and I would expect if you copy that, it should work for you as well.

https://community.qlik.com/t5/Qlik-Monitoring-Administration/QlikView-Governance-Dashboard/gpm-p/157...

Otherwise you can follow-up with Rob, sorry I do not have anything better at the moment.  There was a timestamp formatting change between 11.20 and 12.xx tracks, but I cannot see that that should be a major issue here, that is where I am hoping the GDB QVW script may be of some help to you.  There may be logic in there to handle 11.20 v 12.xx too, just FYI.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Note also that the date format differs in V11 and V12.  In V11, log dates are in the TimeStamp format set in the script, which is usually localized.  In V12, the format is always ISO 'YYYY-MM-DD hh:mm:ss'.

-Rob

'