I am wanted to calculate shift Analysts VPN session start and end time duration to exactly capture the shift during 24 hours as I have 3 shifts with following timings Morning Shift time = 7am to...
See more...
I am wanted to calculate shift Analysts VPN session start and end time duration to exactly capture the shift during 24 hours as I have 3 shifts with following timings Morning Shift time = 7am to 3pm Evening Shift time = 3pm to 11pm night shift time duration = 11pm to 7am next morning Currently I constructed following query that is having wrong data whenever i increase time more than 24 hours how i can put if condition in this query to add a column Shift time (morning ,evening ,night ) based on Start and end time if condition time range ? index=it sourcetype=pulse:connectsecure vendor_product="Pulse Connect Secure" realm=Company-Domain+DUO1001 earliest=-24 | iplocation src | eval Attempts= if(vendor_action="started","Session_Started","Session_Ended") | stats values(Attempts) AS All_Attempts values(src) AS src count(eval(Attempts="Session_Started")) AS Started count(eval(Attempts="Session_Ended")) AS Ended min(_time) AS start_time max(_time) AS end_time by user | eval Duration=end_time-start_time | search user=Analyst1 OR user=Analyst2 OR user=Analyst3 OR user=Analyst4 OR user=Analyst5 OR user=Analyst6 OR user=Analyst7 OR user=Analyst8 OR user=Analyst9 | convert ctime(start_time) | convert ctime(end_time) | eval totall_duration=tostring(Duration,"duration") | table user,All_Attempts,src,Started,Ended,start_time,end_time,totall_duration In excel I am using following formula to calculate the shift duration from ticket close time =IF(HOUR(E2)<7,"Night Shift",IF(HOUR(E2)<15,"Morning Shift",IF(HOUR(E2)<23,"Evening Shift","Night Shift"))) How I can insert similar condition in splunk to get the result intron of a new calculated column called shift with Session started and session End (time duration between both times)? @manjunathmeti @woodcock