Forum Discussion
Are iRule instances scoped to a request/response?
Just adding to Roberts answer. Like he said, the variables are unique per connection. With HTTP pipelining there can be multiple requests within a connection. To make sure that a variable is "reset" for each request you can use the unset command, or set it to something generic in the beginning of the rule, such as an empty string or 0.
In your rule the cnParamValue would be set each time the request is sent, and would not affect anything outside the connection it's in. If you want you could unset it in the HTTP_RESPONSE event.
when HTTP_REQUEST {
set cnParamValue $value
}
when HTTP_RESPONSE {
if { [info exists cnParamValue] and $cnParamValue ne "" } {
log local0. $cnParamvalue
unset cnParamValue
}
}
/Patrik
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
