Forum Discussion

Raj_Zucre_Ramir's avatar
Raj_Zucre_Ramir
Icon for Nimbostratus rankNimbostratus
Apr 13, 2010

HTTP::header "User-Agent"

Hi guys,

 

 

I'm using this irule, but got an error:

 

 

if {[class match [HTTP::header "User-Agent"] contains "Acre_UserAgent"]} {

 

pool Acre_pool

 

return

 

}

 

 

01070151:3: Rule [class_me] error: line 1: [command is not valid in the current scope] [if {[class match [HTTP::header "User-Agent"] contains "Acre_UserAgent"]} { pool Acre_pool return }]

 

 

 

and if i changed it to:

 

 

if {[class match [HTTP::header User-Agent] contains Acre_UserAgent]} {

 

pool Acre_pool

 

return

 

}

 

 

01070151:3: Rule [class_me] error: line 1: [command is not valid in the current scope] [if {[class match [HTTP::header User-Agent] contains Acre_UserAgent]} { pool Acre_pool return }]

 

 

Please help.

 

 

Thanks!

 

Raj

 

1 Reply

  • Hi Raj,

    Which iRule event are you testing this in? I'd expect HTTP_REQUEST. That seems to work for me on 10.1.0:

    
    when HTTP_REQUEST {
       if {[class match [HTTP::header "User-Agent"] contains "Acre_UserAgent"]} {
          pool Acre_pool
       }
    }
    

    Aaron