I want to measure the time between two jobs in a logfile
0
votes
1
answer
190
views
I have a logfile which name/directory is:
/srv/uni/kani/LogDay.09-03-2016
The name of the logfile changes date every day. So tomorrow will be: `LogDay.10-03-2016' and so on...
I would like help to create a script who looks through that file and finds this line:
08-03-2016 19:00:01 b5121 DISPLAY ID(IP[RANDOMIPADRESS] PID) MSG[BEGIN JOB /srv/uni/PROD/PNRUN/PN4949D
and measures the time in minutes until this job is written in the log:
08-03-2016 19:19:17 b7285 DISPLAY ID(IP[RANDOMIPADRESS] JOB[FO1008] PID) MSG[END JOB /srv/uni/PROD/PNRUN/FO1008D, , 27392]
There is alot of other lines in the log.. with other jobs saying BEGIN job and END job and so on. But its those 2 specific i want to measure the time between.
I would like to use this script at the end of the evening to see how long all the jobs took totally. Instead of having to go in the log and count manually...
And I want to put it in a bash script :)
I would like the output to say something like.
Tonights work took totally X hour X minutes.
Can anyone help me with that?
Asked by David
(1 rep)
Mar 9, 2016, 03:05 PM
Last activity: Mar 10, 2016, 08:47 PM
Last activity: Mar 10, 2016, 08:47 PM