What I am doing is looking back 8 days (earliest -8d@d latest now) and calculating the duration of job run's. Where I am running into an issue is where a job started from one day and the previous day instead of just starting on a unique day. Here is my whole SPL: I tried Min(...) & max(...) but it assigned one value for every row, instead of on the one row that has two results. index=anIndex sourcetype=aSourceType aJobName ("START of script" OR "COMPLETED OK") | eval startTimeRaw = if (match(_raw, "START of script"), _time, null()) | eval endTimeRaw = if (match(_raw, "COMPLETED OK"), _time, null()) | eval eventDate=strftime(_time,"%Y-%m-%d") | stats range(_time) as duration values(startTimeRaw) as startTimeRaw values(endTimeRaw) as endTimeRaw by eventDate, host | eval durationTime = tostring (duration, "duration") | eval aTime1= startTimeRaw- (strptime(strftime(startTimeRaw,"%Y-%m-%dT%H:%M:%S.%3N")." CDT","%Y-%m-%dT%H:%M:%S.%N%Z") - startTimeRaw) | eval startDateTimeCDT=strftime(aTime1, "%Y-%m-%d %H:%M:%S") | eval aTime2= endTimeRaw - (strptime(strftime(endTimeRaw,"%Y-%m-%dT%H:%M:%S.%3N")." CDT","%Y-%m-%dT%H:%M:%S.%N%Z") - endTimeRaw) | eval endDateTimeCDT=strftime(aTime2, "%Y-%m-%d %H:%M:%S") | eval startTimeCDT=strftime(aTime1, "%H:%M:%S") | eval endTimeCDT=strftime(aTime2, "%H:%M:%S") | eval host = if (host="aHost1", "aHost1-Name", "aHost2-Name") | eval "Duration"=durationTime | eval "End Time (CDT)"=endTimeCDT | eval "Start Time (CDT)"=startTimeCDT | eval "Start Date / Time (CDT)"=startDateTimeCDT | eval "End Date / Time (CDT)"=endDateTimeCDT | eval "Day Of Week"=strftime(aTime2,"%A") | table duration, startTimeRaw, endTimeRaw, "Host Name", "Day Of Week", "Job Name", "Start Date / Time (CDT)" "End Date / Time (CDT)", "Start Time (CDT)", "End Time (CDT)", "Duration" I have attached a screenshot of my results. The line that is causing issues is the one with two startTimeRaw(s)...
... View more