Forum Discussion

Chris_Chaloux_1's avatar
Chris_Chaloux_1
Icon for Nimbostratus rankNimbostratus
Jul 15, 2008

iRule with embedded html

Can anyone help me understand why the below code checks out OK in the iRule editor, but when I try to upload it to the F5 I get the following error:

 

 

line 1: [braces are required around the expression] [when HTTP_REQUEST {

 

if { ([HTTP::path] contains "dss") } {

 

set page_code {

 

 

 
 when HTTP_REQUEST { 
 if { ([HTTP::path] contains "dss") } { 
 set page_code { 
  
 Temporarily Out Of Service 
  
  
   
              
                                            
              
                                
   
      
            
            
      
   The site is temporarily out of service.  We apologize for any inconvenience and will have the site available again as soon as possible.  Thank You!  You may still be able to access certain sites by clicking the following links:   
  
 Credit Union 
 Employee Tools 
 Jour 
  
        
  
  
      
              
     
            
      Copyright. All rights reserved.   
  
  
  
 } 
  Send an HTTP 200 response 
 HTTP::respond 200 content [subst $::page_code] } 
 } 
 

 

 

Thanks in advance for any advice. Also, if anyone can think of a different way to do this, I'll take all the help I can get!
  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    That loads via the GUI in 9.3.1. It also works when running 'b load'. Which version of LTM are you running?

     

     

    Also, you're setting a local variable in HTTP_REQUEST called page_code, but referencing a global variable $::page_code later in the rule.

     

     

    Aaron
  • Hoolio - thanks a ton!! Thats exactly what it was and I entirly over looked it. It was the global variable reference that was hanging this up. Works like a charm!