Forum Discussion
iRule for Timed response during maintenance window on LTM
iRule for Timed response during maintenance window on LTM I want to check for iurl pattern match ("/ent-report-services/") using a asterisk as the wildcard. The iRule is seeing the asterisk as a character, not a wildcard. So "https://10.10.10.10/ent-report-services/" matches and I get the correct maintenance message. But, "; does not match.
Maintenance window is 7am Saturday (day6) until 7am Sunday (day7)
Please review my syntax and let me know what I need to change to get the wildcard to match anything after https://10.10.10.10/ent-report-services/
Here is my current iRule.
when RULE_INIT { set static::START_OFF_TIME [clock scan "07:00 AM"] set static::END_OFF_TIME [clock scan "07:00 AM"] } when HTTP_REQUEST { set now [clock seconds] set current_day [clock format [clock seconds] -format {%u}] if { (([string tolower [HTTP::uri]] contains "/ent-report-services/") && ($current_day == 6 ) && ( $now > $static::START_OFF_TIME )) || (([string tolower [HTTP::uri]] contains "/ent-report-services/") && ($current_day == 7 ) && ( $now < $static::END_OFF_TIME ))} { HTTP::respond 503 content "Maintenance ModeService is down for maintenance. Please try again later.." } }
I couldn't see asterisk in the iRule. It may be better to replace "contains" with "starts_with".
- Richard_Grigsby
Nimbostratus
I guess the asterisks did not transfer.
I changed to "starts_with", removed the asterisk. It seems to be working.
Thank You
- HarshaPotharaju
Nimbostratus
No need to use asterisk if use 'starts_with'.
Recent Discussions
Related Content
* 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