can anyone help me with some examples where service policy should be used instead of using an iRule and vice versa but remember example should be where requirement can be acheived using both service policy and irule but wanted to know where service policy is best fit over irule and example where iRule is best fit over service policy
This largely comes down to what you’re used to.
Some people prefer using Policies for straightforward logic, turning to iRules only when more complex behavior is required.
Others, however, will use iRules regardless of the situation.
Policies are generally easier to configure and maintain, especially for those with less experience—which can be a key factor in long-term maintainability.
On the other hand, iRules offer nearly limitless flexibility, making them ideal for advanced use cases.
Got it but if we have configured multiple service policy rules which one takes precedence. In irules lower priority takes precedence but I want to know the execution order of service policies
If you have both Policy and iRule, Policy comes first.
If you have multiple policies with confilcting controls you will not be able even to apply them
check https://my.f5.com/manage/s/article/K55864758#ai-recommendations-42
There is a great article explaining what you are asking, have a look
Knowledge sharing: An example of the general order of precedence for the BIG-IP modules. Also, the F5 ASM DDOS Protection or Bot Protection order of precedence explained. | DevCentral
Perfect thanks
thanks for your prompt response
Appreciated ![]()
It is written ASM DDoS is going to be executed first then Bot Defense and after that ASM Policy.
With respect to LTM and ASM like we have service polices, irules etc etc
Is it the order would be like ASM DDos > Bot Defense > Service Policies > Irule (if configured) > then rest of the settings configured at layer 7 security in ASM
It depends on the context of Policy or iRule.
For example an irule could have Client_Connect event which is triggered before even the actual request, or HTTP_REQUEST_RELEASE which hits just before the request leaves F5.
More over you could even disable ASM with an irule or select spesific ASM policy.
