Forum Discussion
GavinW_29074
Dec 08, 2011Nimbostratus
Extract value from VirtualName
Hi there,
I'm trying to write an iRule condition that needs to know part of the [Virtual Name] value...
A couple of examples are:
/Common/Test.App/app.test.com_https
/Common/app2.test.com_http
I want to get the bit between the last '/' and the '_'...
I've tried using the scan command as follows:
scan $virtualname {%*[^/]/%[^_]} vname
log local0. "\$vname = $vname"
However I keep getting: can't read "vname": no such variable while executing "log local0. "\$vname = $vname""
Any ideas???
Or is there a better way of doing it?
Cheers
Gav
- hooleylistCirrostratusHi Gavin,
if {[scan $virtualname {%*[^/]/%[^_]} vname] == 1}{ log local0. "Matched $vname from $virtualname" } else { log local0. "Couldn't parse $virtualname" }
- GavinW_29074NimbostratusAaron
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects