For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

fasteddye's avatar
fasteddye
Icon for Nimbostratus rankNimbostratus
Mar 11, 2014

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

  • 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"
      }
    }
    
  • 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!)