Forum Discussion
Braces are required around expression when HTTP_REQUEST
We have BigIP LTM 10.2.4 HF3. We are trying to test having an iRule help with web site down/maintenance window messages. When attempting to create the iRule below I receive, 01070151:3: Rule [MaintenanceTest] error: line 1: [braces are required around the expression] [when HTTP_REQUEST { if { [active_members Test_Pool] < 1 } { HTTP::respond 200 content.......
I am pretty limited in my iRule and HTML skills but from what I have been able to find is that this may be due to v10 and iRule with double byte character.
Or maybe I am going about this entirely the wrong way.
Any advice is greatly appreciated.
Sample of iRule trying to create
when HTTP_REQUEST { if { [active_members Test_Pool] < 1 } { HTTP::respond 200 content {
Regular Maintenance Window
Daily Restart of Services: 3:30 AM – 4:30 AM
During this time frame, your activities may be disrupted. Use caution working in Test System during the maintenance window, and refrain from high risk activities such as taking or building quizzes/tests.
*********************************************************************************************************************************************************
To all Users,
Test System is currently down. Maintenance hours are 3:30 AM – 4:30 AM daily. If you encounter this page during the referenced time frame, this is a scheduled disruption. Please try accessing Test System after 4:30 AM.
If you are receiving this notice outside of the maintenance window, and believe you have received this message in error, please contact the Service Center at 123-456-7890 or toll free at 800-123-4567. You may also submit your request for support or information online by visiting the Service Center website at: http://www.abc.com
We are working to restore service as quickly as possible and apologize for any inconvenience this downtime may be causing you.
Thank you.
The Test Service Team
} Cache-Control No-Cache Pragma No-Cache
} }
2 Replies
- JRahm
Admin
you would want a fully compliant html page there complete with tags. Most use iFiles, which of course are not yet available to you on your version, but you can put the html in a variable in RULE_INIT.
when RULE_INIT { set static::sorry_page "..." } when HTTP_REQUEST { if { [active_members Test_Pool] < 1 } { HTTP::respond 200 content $static::sorry_page Cache-Control "no-cache" Pragma "no-cache" } } - fasteddye
Nimbostratus
I was copying the text from notepad into the iRule screen through the F5 web interface. It does appear it may have ended up being a wierd dash character. I went through one by one changing each dash and after changing the last dash the iRule went through. I also went ahead and changed to the recommended HTML format as well. (Thanks Kevin!)
We will have v11 in the not too far future so hopefully we will then be able to utilize iFiles. (Thanks Jason!)
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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