Forum Discussion

viziony's avatar
viziony
Icon for Cirrus rankCirrus
Dec 07, 2022

iRule Help on Logging the cookie parameter's value.

Hello There --

Would like to get your assistance on logging from an iRule. I would like the irule to log to the LTM logs to see if the connection is sending over the cookie parameter's value 

 

 

when HTTP_REQUEST {
if { [HTTP::header "Route-to-AB”] equals "YES" }{
    pool pool-A
    // log local0.info ?
} else {
    pool pool-B
   //  log local0.info ?
   }
}

 

 

The same above, I want to make sure I using "Log local0.info" correctly. If additional information is required for the logging to work? I just want to see if the header includes the parameter "Route-to-AB" with a value. 

 

1 Reply

  • Hi viziony,

    check out the modified iRule below...

     

    
    when HTTP_REQUEST {
    	if { [HTTP::header value "Route-to-AB"] equals "YES" } then {
    		pool pool-A
    		log local0.info "Header \"Route-to-AB\" value is \"YES\"."
    	} else {
    		pool pool-B
    		log local0.info "Header \"Route-to-AB\" value is \"[HTTP::header value "Route-to-AB"]\"."
    	}
    }

     

    Note: You may change the log-level "info" to "debug" if subsequent messages getting supressed. LTM has a filter for non debug messages.

    Cheers, Kai