Forum Discussion
ramann_75062
Nimbostratus
Dec 12, 2007Time & Date
Hello together,
is it possible, to define a start/stop time/date for a irule?
thanks
bjoern
- JRahm
Admin
I don't think you can selectively have the rule or not, the rule's presence against a virtual server is determined at load time. You can however, use time and date to determine on whether or not your commands fire.when RULE_INIT { set off_hours 0 set ::time_min [clock scan {10:00}] set ::time_max [clock scan {17:00}] } when CLIENT_ACCEPTED { set current_day [clock format [clock seconds] -format {%a} ] set current_time [clock seconds] if {($current_day == {Sat}) or ($current_day == {Sun})} { set off_hours 1 } elseif {($current_time < $::time_min) or ($current_time > $::time_max)} { set off_hours 1 } } when HTTP_REQUEST { if { !$off_hours} { log local0. "Work Hours...processing event commands." } else { log local0. "Off Hours...exit event." } } when HTTP_RESPONSE { if { !$off_hours} { log local0. "Work Hours...processing event commands." } else { log local0. "Off Hours...exit event." } }
- JRahm
Admin
Another alternative would be to write an iControl script to add/remove the iRule from your virtual(s) at the desired times. - Colin_Walker_12Historic F5 Accountcitizen_elah is correct here. There is currently no way to indicate an execution time for your iRule as a whole, just portions from within the iRule itself.
- ramann_75062
Nimbostratus
thanks a lot :-)
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects