Forum Discussion

Caio_Alves_3559's avatar
Caio_Alves_3559
Icon for Nimbostratus rankNimbostratus
Apr 24, 2018

problem with irules

when RULE_INIT{ log local0."iRule created or updated" } when CLIENT_ACCEPTED { log local0."in CLIENT_ACCEPTED" } when HTTP_REQUEST{ log local0."Client made an http request" } when LB_SELECTED { log local0."Pool member selected" } when SERVER_CONNECTED { log local0."Connection made with pool member" } when HTTP_RESPONSE { log local0."Pool member made an HTTP response." }

 

Exception caught in LocalLB::urn:iControl:LocalLB/Rule::modify_rule() Exception: Common::OperationFailed primary_error_code : 17236305 (0x01070151) secondary_error_code : 0 error_string : 01070151:3: Rule [/Common/exercise_iRule] error: /Common/exercise_iRule:1: error: [wrong args][when RULE_INIT{] /Common/exercise_iRule:2: error: [command is not valid in the current scope][log local0."iRule created or updated"] /Common/exercise_iRule:3: error: [command is not valid in the current scope][}] /Common/exercise_iRule:5: error: ["invalid argument local0."in"][log local0."in CLIENT_ACCEPTED"] /Common/exercise_iRule:7: error: [wrong args][when HTTP_REQUEST{] /Common/exercise_iRule:8: error: [command is not valid in the current scope][log local0."Client made an http request"] /Common/exercise_iRule:9: error: [command is not valid in the current scope][}] /Common/exercise_iRule:11: error: ["invalid argument local0."Pool"][log local0."Pool member selected"] /Common/exercise_iRule:14: error: ["invalid argument local0."Connection"][log local0."Connection made with pool member"] /Common/exercise_iRule:17: error: ["invalid argument local0."Poolmember"][log local0."Poolmember made an HTTP response."]

 

Are you presenting these errors in irule syntax, need help solving

 

2 Replies

  • I think it was a formatting issue, please format your iRule like this:

    when RULE_INIT { 
        log local0."iRule created or updated" 
    } 
    
    when CLIENT_ACCEPTED { 
        log local0."in CLIENT_ACCEPTED" 
    } 
    
    when HTTP_REQUEST { 
        log local0."Client made an http request" 
    } 
    
    when LB_SELECTED { 
        log local0."Pool member selected" 
    } 
    
    when SERVER_CONNECTED { 
        log local0."Connection made with pool member" 
    } 
    
    when HTTP_RESPONSE { 
        log local0."Pool member made an HTTP response." 
    }
    
  • Hello,

    try this (it's important to put a space between "local0." and your logs. otherwise you will have an error when creating the irule). MrPlactick is right is just a formating issue but additional you have to put a space between "local0." and your logs...

    Like this: log local0. "blablabla"

    when RULE_INIT { 
        log local0. "iRule created or updated"
    }
    
    when CLIENT_ACCEPTED { 
        log local0. "in CLIENT_ACCEPTED"
    }
    
    when HTTP_REQUEST { 
        log local0. "Client made an http request"
    }
    
    when LB_SELECTED { 
        log local0. "Pool member selected"
    }
    
    when SERVER_CONNECTED { 
        log local0. "Connection made with pool member"
    }
    
    when HTTP_RESPONSE { 
        log local0. "Pool member made an HTTP response."
    }
    

    Regards