Forum Discussion
unRuleY_95363
Jun 14, 2006Historic F5 Account
You don't need to actually select a class to make this work. If you look at the _ASM_clientside rule, all you really need to do is replicate the code that happens in the HTTP_CLASS_SELECTED event.
So, what I would probably do is make two HTTP classes (one with ts_enabled, but that won't actually match anything - this is needed to properly configure the virtual for routing to ASM) and then another class that actually matches everything but does not have ts_enabled (it must have ts disabled so that your replacement rule will function correctly with the _ASM rules). Then create a rule that copies just the HTTP_CLASS_SELECTED event from the ASM clientside rule. Add your selection logic to the top of that event and sets tmm_ts_httpclass_selected to 1 or 0 depending on whether you want to go through ASM or not. Then replace the first "if {[PROFILE::httpclass [HTTP::class] ts_enabled] == 1}" check with a simpler "if {$tmm_ts_httpclass_selected}" check (which now bases the decision to route to ASM on the logic you just added to the top of the rule. That should be it.
Good luck.