okay, hard to test without any real data ... try this:
source="file.csv" date_month=august date_hour>08 AND date_hour<18 NOT ( date_wday=Saturday OR date_wday=Sunday )
| eval epoch_A=strptime('start_TIME',"%d/%m/%Y %I:%M:%S %p")
| eval epoch_B=strptime('close_TIME',"%d/%m/%Y %I:%M:%S %p")
| eval total_TIME=if((epoch_B-epochA)>57600, (epoch_B-epcoh_A-57600)/3600, (epoch_B-epcoh_A)/3600 )
| table start_TIME, close_TIME, total_TIME
The if statement is based on the fact, that if the difference between start and end time is bigger as 57600 seconds (17 hours or 5pm to 9am) then this job was running over night and you simply minus those 17 hours from the total time.
hope this helps ... and this is un-tested 😉
cheers, MuS
... View more