Forum Discussion
Variables used across Different Events
Hi,
Can we use the same variable in different events.
Here in the below iRule can we use the variables declared in the HTTP_REQUEST event also in the HTTP_RESPONSE event.
when HTTP_REQUEST
{
SET FLAG 1
SET CLIENT [IP::client_addr]
}
when HTTP_RESPONSE {
if {$FLAG} {
SET SERVER [IP::remote_addr]
log local0 10.10.10.10 "$CLIENT -- $SERVER"
}
}
Thanks,
Yugandhar.
- jaikumar_f5
Noctilucent
Yugandhar,
Local variables are connection based,http request and http response are of same connection, so yes they will have same values across events you are defining.
You can go through Colin's variable articles if need be or irule wiki to know more about.
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