Forum Discussion
Reason for iRule Execution Error
Will go bit different way to solve issue. It will be easy to add more url in datagroup
class. Lets try and update if working.
class host_url {
access.testxyz45.com
abc.testxyz45.com
def.testxyz45.com
mail.testxyz45.com
}
when HTTP_REQUEST {
if { [matchclass [string tolower [HTTP::host]] equals host_url] } {
persist source_addr 255.255.255.255 600
persist source_addr [] [] -- DevCentral Syntax
Link : https://devcentral.f5.com/wiki/iRules.persist.ashx
}
}
I will request user to click iRule which working and solving issue. So that other can be refer.
- YugandharJul 21, 2018
Nimbostratus
Hi F5_Rock,
Thank you for providing the iRule, Can we use a Switch Statement instead of an If stmt.
===========
class host_url {
access.testxyz45.com abc.testxyz45.com def.testxyz45.com mail.testxyz45.com }when HTTP_REQUEST {
switch -glob -[string tolower [HTTP::host]] { host_url { persist source_addr 255.255.255.255 600 } }}
Thanks,
Yugandhar.
- Samir_Jha_52506Jul 21, 2018
Noctilucent
Syntax is different for switch statement. @youssef has already provided switch iRule. Refer his iRule n let us know if any issue.
- YugandharJul 21, 2018
Nimbostratus
Thank you .. I thought 'host_url' will be replaced with the values specified in the Data Group...So we can't refer a Data Group in the Switch Statement :)
- YugandharJul 27, 2018
Nimbostratus
Thank you F5_Rock, I tested the if stmt with matchclass and switch statement & both worked.
- Samir_Jha_52506Jul 27, 2018
Noctilucent
Check the iRule which is correct. It will be helpful for others.
Cheers...
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
