Lookup file jobsla.csv: Contains start and end batch jobnames for different apps, frequency the jobs will run on(like Mon-Fri in below cases), SLA time before which they need to run
Units AppName FreqStart FreqEnd StartJob EndJob SLA_time
Sales ABC Mon Fri AMGABC01 AMGABC10 18:00
Healthcare EFG Mon Fri AMGEFG65 AMGEFG70 01:00
Events in index_jobruns: Contains job starttime, end time, status of different job runs
JobName Agent JobStartTime JobEndTime JobStatus
AMGABC01 PLINUX03 20180906 0300 20180906 0310 COMPLETE
AMGABC12 PLINUX01 20180906 0300 20180906 0310 FAILED
AMGABC10 PLINUX05 20180906 0400 20180906 0410 COMPLETE
AMGEFG65 PLINUX01 20180906 0300 20180906 0310 COMPLETE
AMGEFG70 PLINUX01 20180906 0400 20180906 0410 FAILED
Output Required: I was looking to display if the jobs listed in lookup file in 'StartJob' and 'EndJob' have completed within the SLA_time listed. If its a Saturday or Sunday, the status below should be N/A
Units AppName SLA_Status
Sales ABC Met
Healthcare EFG Missed
Started with the below code to format the date and time was not sure how to proceed. Would appreciate any help. Thank you
index="index_jobruns"
[| inputlookup jobsla.csv | table StartJob ]
| eval JobStartTime=strftime(strptime(JobStartTime, "%Y%m%d %H%M"),"%d.%m.%Y %H:%M")
| eval JobEndTime=strftime(strptime(JobEndTime, "%Y%m%d %H%M"),"%d.%m.%Y %H:%M")
| table Units, AppName, SLA_Status
... View more