DataD Posted July 26, 2007 Share Posted July 26, 2007 Hi all, to fetch a line in a log file to extract data,I used the tFileInputRegex. Besides other lines, the log file has line entries like this:[2007-07-22 15:00:09.211 GMT] performance PERF-1100 some more perf data here ...(131 lines with occurrences of PERF-1100) I have set up a simple job that opens the file and pass it to the tFileInputRegex.After that it just logs the match out with tLogRow.For the tFileInputRegex RegEx property, I have specified "PERF-1100" However, nothing is logged out and no match is found.Debugging the java code, it steps through the log file lines correctly, and also properly instanciate the pattern:java.util.regex.Pattern patterntFileInputRegex_1 = java.util.regex.Pattern.compile("PERF-1100"); However it never get a match inif (!matchertFileInputRegex_1.matches()) ... I even tried with the "GMT" pattern that occurs in each line of the log file, but no match ... After that I tried the very same with pattern 'PERF-1100' as a Perl project and it returns matches However this time it appears that it returns too much matches. A different regex tool returns 131 matches, whereas with JasperETL I stopped the execution after more then 350 matches, still counting ...Anybody experiencing the same?Might this be a bug or some misconfiguration on my side? Appreciate your help!Best regards,Daniel Link to comment Share on other sites More sharing options...
DataD Posted July 27, 2007 Author Share Posted July 27, 2007 specified the wrong reg ex pattern,should have used ".*(PERF-1100).*"Now it returns the 131 occurrences. Cheers, Daniel B) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now