cancel
Showing results for 
Search instead for 
Did you mean: 
Login & Join the DevCentral Connects Group to watch the Recorded LiveStream (May 12) on Basic iControl Security - show notes included.

Any tool to match and update date/time value inside uri request before passing it to backend pool ??

Sukhwinder1011
Nimbostratus
Nimbostratus

Hi Everyone,

 

So the thing is, we are getting a uri request hit from customer on f5 with some time and date format within the uri itself. Now we have this request to update the time 5 min before the actual time inside the uri so let say if uri has time 45 min then i should send 40 min to backend pool. this could be due to latency or processing delays from client end but this is requested from their side.

So coming to original question. Is this really possible in f5 APM or iRule to match on this time string (let me also tell you that format is fix in uri and there is also strings inside the uri "START_TIME:01:00HRS:17thOCT" so we can use this START_TIME to match on). But idea is to store this time 01:00 as some variable like float/integer and perform minus 5 min operation before we can send it to backend pool. Please let me know if iRules or any F5 tool can solve this . Would be highly appreciated.

 

1 ACCEPTED SOLUTION

Yoann_Le_Corvi1
Cumulonimbus
Cumulonimbus

Hi

 

A quick solution that should do the trick You'll just have to wrap around this code to replace the URI sent to the backend...

 

set origTime "START_TIME:01:00HRS:17thOCT"   log local0. "Original VALUE : $origTime"   regexp {(START_TIME:)(\d\d:\d\d)(.*)} $origTime -> start middle end   set origTimeSec [clock scan $resultVar] set newTimeSec [ expr { $s + 300 } ] set newTimeString [clock format $newdate -format {%H:%M}]   log local0. "New VALUE : $start$newTimeString$end"  

Yoann

View solution in original post

3 REPLIES 3

Yoann_Le_Corvi1
Cumulonimbus
Cumulonimbus

Hi

 

A quick solution that should do the trick You'll just have to wrap around this code to replace the URI sent to the backend...

 

set origTime "START_TIME:01:00HRS:17thOCT"   log local0. "Original VALUE : $origTime"   regexp {(START_TIME:)(\d\d:\d\d)(.*)} $origTime -> start middle end   set origTimeSec [clock scan $resultVar] set newTimeSec [ expr { $s + 300 } ] set newTimeString [clock format $newdate -format {%H:%M}]   log local0. "New VALUE : $start$newTimeString$end"  

Yoann

Thanks Yoann, I'll give it a try..​

Hi,

 

If OK. Mark it as answered please 🙂

 

Thanks