Local traffic policies and irules together
Problem this snippet solves: Local traffic policies are very useful to define URL-based redirection, virtual servers and pool assignments, host header rewriting...
But some actions can't be done w...
Updated Jun 06, 2023
Version 2.0Stanislas_Piro2
Cumulonimbus
Joined January 04, 2011
Martin_Robbins
Dec 07, 2016Nimbostratus
We had the same issues but we are also using the 'reset' response option in the LTM policy, this caused all sorts of issues and hideous errors within events that were still trying to run in the HTTP_REQUEST event.
The 'reset' action logs as 'forward' in the POLICY::targets so is not possible to distinguish from a pool selection.
I found a workaround, it seems to work fine on 11.6.1 and 12.1.1 but I am not sure if it will cause issues on other versions.
Adding a set-variable with any name but with the expression
tcl:[event disable all]
So in the properties I have something like:
Name Conditions Actions
reset http-uri path starts-with /reset forward reset
tcl set-variable name iRuleDisable
expression tcl:[event disable all]
This will cause all iRule events (usually with a reset only HTTP_REQUEST and CLIENT_CLOSED) to be switched off but if you are resetting the connection that probably makes sense anyway.