Hello,
I think it's very hard with the use of earliest and latest to do it for last 2 months. The best way i could think of is like this:
index=infra_nb sourcetype=nbjobs earliest=-2mon@mon latest=@mon|eval ignore_hour=strftime("_time","%H")|where ignore_hour < 12 AND ignore_hour > 18|eval month=strftime(_time,"%b")|eval day=strftime(_time,"%d")|eval mod_date=if(ignore_hour<18,day,day=day+1)|stats min(_time) as start,max(_time) as End by Policy,day,month|eval diff=End-start
Of-course you could tweak a little if there is any mistake OR any better solution can be suggested. Thanks
... View more