Hello, I need to find the string error in a log file and that the output shows the error line and 3 lines before. How can I do that? Maybe this code works, but it doesn´t show the error line: "select Index, Text from 'C:\xxx.log' where text like 'error' or
index IN (select SUB(index,1) from ''C:\xxx.log'' where text like '%error%')" Thank you
andressk
1 Post
Found error line and -3 lines
Aug 09, 2011 02:16 AM|LINK
StormInterne...
213 Posts
Re: Found error line and -3 lines
Nov 13, 2011 04:55 PM|LINK
HCamper
8048 Posts
Re: Found error line and -3 lines
Nov 14, 2011 11:23 AM|LINK
Hi,
Not sure if you have this resolved ? Sorry that Log Parser does not explain more about errors.
It would help if you post a section from the log file to see what types Strings Integers Labels Decimals need to be parsed.
The problem with logs files is the type ( String or Integer) for a given entry in a log file.
If you look at the Functions page at Log Parser Plus http://logparserplus.com/Functions .
You could try using TO_STRING Function to see if the error changes ( Trial and Error ).
You could use the TO_UPPER Function to see if the error changes ( Trial and Error).
The problem might be with the select and the "Index" and "Text" column names hard to tell from the post.
HTH
Martin
Community Member Award 2011