Forum Discussion
Is there a way to check if a virtual server exists from within an iRule?
We use virtual calls to deal with special needs for back end connections like NTLM or Server Side SSL on our main front vips. There are quite a few different combinations that we use to deal with these back end connections, and the switch statement that we've been using is starting to get a bit cumbersome. I was wondering if there was a way to do a lookup and see if a virtual exists rather than having to spell them out.
when HTTP_REQUEST {
set mapping [class match -value [string toupper [HTTP::uri]] starts_with SFNETSYSPERF01]
switch $mapping {
"subvip1" -
"subvip2" -
"subvip3" -
"subvip4" {
virtual $mapping
}
"" {
virtual subvip-default
}
default {
pool $mapping
}
}
}What I'm looking for is a way to replace the switch with a lookup. I know this isn't correct code, but just looking to get the idea across.
if virtual $mapping exists { virtual &mapping }Is something like that possible within an iRule?
what about "catch" command?
iRules 101 - 07 - Catch by Joe Pruitt
https://devcentral.f5.com/articles/irules-101-07-catch.U1FUeVedGCQ
4 Replies
- nitass_89166
Noctilucent
what about "catch" command?
iRules 101 - 07 - Catch by Joe Pruitt
https://devcentral.f5.com/articles/irules-101-07-catch.U1FUeVedGCQ
- That's it, and the pool example in that writeup can translate over perfectly. Thanks Nitass.
- nitass
Employee
what about "catch" command?
iRules 101 - 07 - Catch by Joe Pruitt
https://devcentral.f5.com/articles/irules-101-07-catch.U1FUeVedGCQ
- That's it, and the pool example in that writeup can translate over perfectly. Thanks Nitass.
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
