Forum Discussion
iRule error
Hello Folks,
I am working on a migration project for a customer. For some reason the iRule isn't allowing me to use "ASM::enable" event within else condition.
Following is the old and new iRules.
The old one:
ltm rule /Common/ABC-URI {
when HTTP_CLASS_SELECTED {
if {[IP::addr [IP::client_addr] equals 10.250.0.0/16]} {
if { [HTTP::uri] contains "/Server/ServletSM" } {
ASM::disable
}
} elseif {( [class match [IP::client_addr] equals ADMIN_Pool] )} {
if { [HTTP::uri] contains "/sv" } {
ASM::disable
}
} elseif { [class match [string tolower [HTTP::uri]] contains CRM_CHAT_URIS] } {
ASM::disable
} else { ASM::enable
}
}
}
Here is the updated copy.
when HTTP_REQUEST {
if {[llength [POLICY::names matched]] > 0} {
if {[IP::addr [IP::client_addr] equals 10.250.0.0/16]} {
if { [HTTP::uri] contains "/VGServer/VGServletSM" } {
ASM::disable
}
} elseif {( [class match [IP::client_addr] equals AD_PORTAL_SV_ECM] )} {
if { [HTTP::uri] contains "/sv" } {
ASM::disable
}
} elseif { [class match [string tolower [HTTP::uri]] contains CRM_CHAT_URIS] } {
ASM::disable
}
}
else {
ASM::enable
}
}
However the "else" part in the Updated iRule doesn't seem to be working. Especially "ASM::enable" event. If I change it to "ASM::disable" it works.
I am failing to understand this.
Any help?
Thank you, Darshan
3 Replies
- nathe
Cirrocumulus
Darshan, I assume you are now at tmos v11.4 or later? If so you will need the policy name after ASM::enable.
See
https://devcentral.f5.com/wiki/iRules.ASM__enable.ashx for clarification.
Hope this helps,
N
- swo0sh_gt_13163
Altostratus
You are the man Nathan! It isn't showing any syntax error for now...
Thank you! Darshan
- nathe
Cirrocumulus
Great news
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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