Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
thabo2g5
Contributor III
Contributor III

loading log file error message into qv

Hi everyone

i have a log file i only need to load the error message in qvw . i used  table files button to load it but i'm getting everything i just want the error message that is generated by this log file so that i can display it on dashboard if it fails to reload . loaded the log file as attachement

Thank you in advance

1 Solution

Accepted Solutions
prieper
Master II
Master II

ErrorsInLog:

LOAD [@1:20]     AS Time,

     [@21:26]    AS Line,

     [@27:n]     AS Message

FROM

[IT Service Desk - Incidents.qvw.log]

(fix, unicode, no labels)

WHERE WILDMATCH([@27:n], '*ERROR:*');

View solution in original post

4 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

In order to get to the error message, you will have to load everything in any case, as it is often the last thing written to the log file. Text files are not databases, they must be read sequentially.

Create a LOAD statement that parses the first 25 characters and puts them in a Date + Time + (optionally) Linenumber field. Put the remainder in a fourth field called "Message" or something. Then add a WHERE clause that skips all lines that don't have the word "Error:" after the 25th character.

thabo2g5
Contributor III
Contributor III
Author

thank you very much for your response may you please show me via an example ?

prieper
Master II
Master II

ErrorsInLog:

LOAD [@1:20]     AS Time,

     [@21:26]    AS Line,

     [@27:n]     AS Message

FROM

[IT Service Desk - Incidents.qvw.log]

(fix, unicode, no labels)

WHERE WILDMATCH([@27:n], '*ERROR:*');

thabo2g5
Contributor III
Contributor III
Author

thank you very much this is what i was looking for