Forum Discussion
Jun 13, 2008
Sure it's possible. By using the TCL clock command it's rather simple:
Something like this should do the trick:
when HTTP_REQUEST {
if { [clock seconds] < [clock scan {2008-07-04}] } {
HTTP::redirect "http://someothersite"
}
}
The clock command uses the number of seconds since the epoch (1970/01/01-00:00:00) if you were interested.
*warning, this hasn't been tested so give it a little bit of testing first.
Oh, and if you want to optimize the iRule a bit, log out what the value is from the "clock scan" command and hard code that in. That way you won't need to parse the date each time a request comes in.
One more thing... The tech tip I wrote on iRule Maintenance Windows might be of some interest to you as well:
http://devcentral.f5.com/Default.aspx?tabid=63&articleType=ArticleView&articleId=70
Click here
Hope this helps...
-Joe