Forum Discussion
PaulMS
7 years agoSuper Contributor
def logfile = '''2018-02-26 10:41:21,076 [KilimWorker-4] TRACE org.hibernate.type.descriptor.sql.BasicBinder - binding parameter [6] as [VARCHAR] - REFER 2018-02-26 10:41:21,077 [KilimWorker-4] TRACE org.hibernate.type.descriptor.sql.BasicBinder - binding parameter [7] as [VARCHAR] - PRE_REFER 2018-02-26 10:41:21,077 [KilimWorker-4] TRACE org.hibernate.type.descriptor.sql.BasicBinder - binding parameter [8] as [TIMESTAMP] - 2018-02-08 23:00:52 2018-02-26 10:41:21,078 [KilimWorker-4] DEBUG com.vedaadvantage.dp3.manager.actor.Message - Audit event Individual_Duplicate_Check_Referred - End 2018-02-26 10:41:21,078 [KilimWorker-4] DEBUG com.vedaadvantage.dp3.manager.actor.DispatcherActor - execute ''' logfile.eachLine { currentLine, lineNumber -> if (currentLine.contains( 'Individual_Duplicate_Check_Referred' )) { previousLine = logfile.readLines()[lineNumber - 1] } } def timeStamp = previousLine.split(' - ').last(); def Date ts = new Date().parse("yyyy-MM-dd HH:mm:ss", timeStamp) log.info new Date() - ts
- sairamau7 years agoNew Contributor
Thanks Paul, i will give a go with this, will update you
Related Content
- 3 years ago
- 11 years ago
- 6 years ago