I am trying to snip out Java Thread dumps from potentially very large files - the one I am testing on is 60MB. The section of interest will always begin with a line like:
Full thread dump Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode):
And end just before a line like this - a Warning or Error - I don't mind an extra line at the end but wouldn't mind losing it.
**** Warning Sat Apr 01 03:15:21 EST 2006 1143879321293 / ServletUtil atg.service.resourcepool.ResourcePoolException: attempt to obtain a resource from a pool that is not running atg.service.resourcepool.ResourcePoolException: attempt to obtain a resource from a pool that is not running
awk '/Full thread dump/,"****"==$1' jvmoutput.log > ThreadDump.log
Gets me that - but if there are multiple dumps within the log file I only want the last one.
Full thread dump Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode):
And end just before a line like this - a Warning or Error - I don't mind an extra line at the end but wouldn't mind losing it.
**** Warning Sat Apr 01 03:15:21 EST 2006 1143879321293 / ServletUtil atg.service.resourcepool.ResourcePoolException: attempt to obtain a resource from a pool that is not running atg.service.resourcepool.ResourcePoolException: attempt to obtain a resource from a pool that is not running
awk '/Full thread dump/,"****"==$1' jvmoutput.log > ThreadDump.log
Gets me that - but if there are multiple dumps within the log file I only want the last one.