Forum Discussion
Brandon_High_10
Nimbostratus
Dec 23, 2004"detach" command
I'm trying to use the "detach" command in an iRule and receive the following error when entering it:
line 25: [undefined procedure: detach] [detach]
Is there another way to achieve the same effect, or will I have to wait for a fix from F5?
7 Replies
- bl0ndie_127134Historic F5 AccountThe error code indicates that you may be using the wrong syntax. Try this out.
ONECONNECT::detach [enable | disable] - Brandon_High_10
Nimbostratus
I'm not trying to use the ONECONNECT::detach. I'm trying to use the detach command listed on p. 13-9 of the LTM_config_guide.pdf:
detach
Discontinues evaluating this iRule event on this connection. However, the iRule continues to run.
In order to keep the rules from being too huge we have split certain features into different iRules. One example is a rule for our intranet. Because some clients will not store cookies that map to a hostname only, there is a rule that turns a hostname into a FQDN. This allows cookie persistance to work. It does this by using a HTTP::redirect, followed by a return.
There are multiple iRules being applied, each with HTTP_REQUEST a handler. The next file begins to be processed and could potentially send another HTTP::redirect (which fails with IE6), or select a different pool, etc. I want all iRule processing for that event to stop after certain conditions. Using return works in a single iRule, but doesn't work with multiple iRules.
The work around that I've come up with is to have a global variable called $FINISHED, which I set to 1 before calling a return. In each of the iRules, the HTTP_REQUEST handler starts withif { $FINISHED } { return }
to skip the contents of that file. Obviously this is a kludge to emulate the behaviour of the missing detach command. - drteeth_127330Historic F5 AccountDue to a conflict with ONECONNECT::detach, this functionality was moved to the event command. Try this:
event disable all - Brandon_High_10
Nimbostratus
Where can I find more info on the event command? It's not in the LTM_config_guide.pdf or the 9.0.x release notes. - drteeth_127330Historic F5 AccountThe event command will be documented in a future release. However, I reviewed the code, and I don't believe that it will discontinue processing handlers for the same rule event. In fact, I don't see a better way of doing this than what you have done. I have filed a change request so this will be addressed in a future release. Thanks!
- Brandon_High_10
Nimbostratus
Will there be a "detach" or "event disable all" command added back into the 9.x tree? Our current work around works, but isn't exactly elegant. - unRuleY_95363Historic F5 AccountYes, the "event disable" command has been fixed in 9.0.5 (TBR anyday now). The previous command did mostly work except that if you had multiple rules, subsequent event scripts from other rules were still evaluated and the event was only disabled from a new trigger. The command now completely stops processing for any subsequent scripts.
The command has the following syntax:event disable - disable the current event from being evaluated again. event disable - disable a specific event from being evaluated. event disable all - disable all events from being evaluated. event enable - (re)enable a specific event. event enable all - (re)enable all events.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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