vxp has asked for the wisdom of the Perl Monks concerning the following question:
what I need to do is parse this thing, and regard the [datestamp] as the start of a 'chunk' and the next [datestamp] as the end of the previous chunk (and, obviously, a beginning of a new chunk) In essence, I need to check if the <chunk of crap> between [datestamp #1] and [datestamp #2] contains a specific string. any ideas? edit: real snippet of the log file to be parsed:[datestamp] [DEBUG] something here [datestamp] [DEBUG] something else here [datestamp] [ERROR] blah blah <chunk of crap> [datestamp] [INFO] bla bla bla
Code would need to go through these "chunks", find the "DBPoolSQLException" and associate it with the appropriate datestamp it appears under ([Wed Aug 04 00:10:40.666 2010])[Wed Aug 04 00:10:40.591 2010] [DEBUG] [TP-Processor19, time=128089504 +0587, uri=/ibdsupport/workflow/webapp/workflow/coordinator/gotoCoordi +natorNew.cb2] [com.boylesoftware.cb2.BLOBJT.cache]: [208973459] Retri +eve cached object 'segmentProp.map' for segment 142 [Wed Aug 04 00:10:40.591 2010] [DEBUG] [TP-Processor19, time=128089504 +0587, uri=/ibdsupport/workflow/webapp/workflow/coordinator/gotoCoordi +natorNew.cb2] [com.boylesoftware.cb2.BLOBJT.cache]: [208973459] Retri +eve cached object 'segmentProp.map' for segment 142 [Wed Aug 04 00:10:40.666 2010] [ERROR] [TP-Processor19, time=128089504 +0587, uri=/ibdsupport/workflow/webapp/workflow/coordinator/gotoCoordi +natorNew.cb2] [com.boylesoftware.cb2.DAOBJT]: [208973534] Got an erro +r executing query "fetchJobQueueTime" chunk "5". com.boylesoftware.cb2.BLException: Database error in the DAO. at com.boylesoftware.cb2.DAO.executeUpdate_Internal(DAO.java:248 +3) [cb2ms.jar:na] at com.boylesoftware.cb2.DAO.executeNamedQuery(DAO.java:2634) +[cb2ms.jar:na] at com.boylesoftware.cb2.DAO.fetch_Internal(DAO.java:2524) [cb +2ms.jar:na] at com.boylesoftware.cb2.DAO.fetchWithNamedParams(DAO.java:272 +1) [cb2ms.jar:na] at com.boylesoftware.cb2.DAO.fetchWithNamedParams(DAO.java:382 +6) [cb2ms.jar:na] at com.somecompany.insidetrack.tt.project.ProjConsoleBLO.fetch +JobQueueTime(ProjConsoleBLO.java:527) [ProjConsoleBLO.class:na] at com.somecompany.insidetrack.tt.presentation.workflow.JobOve +rviewListPE.init(JobOverviewListPE.java:221) [JobOverviewListPE.class +:na] at com.boylesoftware.cb2.presentation.servlet.ShowPageAction.e +xecute(ShowPageAction.java:141) [cb2ms.jar:na] at com.boylesoftware.cb2.presentation.servlet.CB2Action.execut +e(CB2Action.java:205) [cb2ms.jar:na] at org.apache.struts.action.RequestProcessor.processActionPerf +orm(Unknown Source) [struts.jar:1.1] at java.lang.Thread.run(Thread.java:619) [na:1.6.0_16] Caused by: msjava.dbpool.DBPoolSQLException: The column prefix '#projJ +ob' does not match with a table name or alias name used in the query. + Either the table is not specified in the FROM clause or it has a cor +relation name which must be used instead. (DataSource: insidetrack-db, Type: SYBASE) [Wed Aug 04 00:10:40.666 2010] [DEBUG] [TP-Processor19, time=128089504 +0587, uri=/ibdsupport/workflow/webapp/workflow/coordinator/gotoCoordi +natorNew.cb2] [com.boylesoftware.cb2.DAOBJT]: [208973534] executing c +hunk "6" with a timeout of 360 seconds
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing a file in "chunks"
by zek152 (Pilgrim) on Aug 04, 2010 at 20:46 UTC | |
|
Re: Parsing a file in "chunks"
by toolic (Bishop) on Aug 04, 2010 at 20:28 UTC | |
by vxp (Pilgrim) on Aug 04, 2010 at 20:37 UTC | |
|
Re: Parsing a file in "chunks"
by oko1 (Deacon) on Aug 05, 2010 at 00:22 UTC | |
|
Re: Parsing a file in "chunks"
by ahmad (Hermit) on Aug 05, 2010 at 00:26 UTC | |
|
Re: Parsing a file in "chunks"
by aquarium (Curate) on Aug 05, 2010 at 02:55 UTC | |
|
Re: Parsing a file in "chunks"
by repellent (Priest) on Aug 05, 2010 at 04:53 UTC |