Forum Discussion
Mahesh_56902
Nimbostratus
Mar 30, 2007Context between HTTP request and respose
Can I have context between HTTP request and response? In other words, if I set a variable in an iRule script in request event, can I access it in response event for that connection?
Mar 30, 2007
Sure can, but keep in mind that there are no build-in safeguards for overwriting the values across connections. Counters and totals are fine as they aren't connection specific. You could do something like this:
when RULE_INIT {
set ::total_requests 0
}
when HTTP_REQUEST {
incr ::total_requests 1
}
A better approach though would be to use the Statistics Profile to build your own name/value pairs. This data is peristent and is accessible from within iRules with the STATS::get and STATS::set commands as well as through iControl. Take a look at the Docs section for my latest tech tip on custome reporting with iRules.
-Joe
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects