Hi ,
source="dbmon-tail://idwarehouse/idw_account" application=TFAYD [|inputlookup execSSO.csv |rename sso as owner] |eval exp_date=strftime(relative_time(strptime(lastPasswordChange,"%Y-%m-%d %H:%M:%S"),"+90d"), "%Y-%m-%d %H:%M") |eval CurrentTime=strftime(now(), "%Y-%m-%d %H:%M:%S") |rex field=exp_date "(?\d+):(?\d+)" | rex field=CurrentTime "(?\d+):(?\d+)" | eval in_s = (in_h * 3600) + (in_m * 60) | eval out_s = (out_h * 3600) + (out_m * 60) | eval diff = out_s - in_s | eval tot_h = floor(diff/3600) | eval diff = diff - (tot_h * 3600) | eval tot_m = diff/60 | eval duration = tot_h . ":" . tot_m
My output,
CurrentTime =2014-10-08 13:48:51
application =TFAYD
duration =2:42
exp_date =2014-11-04 11:06
in_h =11
in_m =06
in_s =39960
lastPasswordChange =2014-08-06 11:06:44
out_h =13
out_m =48
out_s =49680
owner =206047117
refreshedDate =2014-10-08 12:19:26
sourcetype =mysql
i am able to calculate the hours,minute,seconds , but i want to calculate the days .... in_d is exp_day , out_d is Current Day ... i want to minus Exp_day - Current Day ..????? in_d - out_d
how can we calculate the day calculations ??? we are able to get the current day field and exp_day field .... we have to minus exp_day - Current Day ...
Thank u ,
Regards,
Siraj
... View more