Forum Discussion
Opher_Shachar_6
Feb 26, 2012Nimbostratus
Looking for a terse expression to get the (base) name of a Virtual
Hello all,
Given that [virtual name] evaluates to "/Common/Lishka.app/Company_vip"
What is the most terse expression to split that into
"/Common/Lishka.app/" and "Company_vip"
I have this:
set vname "[string range [virtual name] [expr [string last / [virtual name]]+1] end]"
set vpath "[substr [virtual name] 0 $vname]"
Thanks,
Opher.
- hooleylistCirrostratusHi Opher,
- hooleylistCirrostratusHi Opher,
when RULE_INIT { set vsnames [list "/dir1/dir2/myvs" \ "/Common/myvs" \ "myvs" \ ] foreach vsname $vsnames { log local0. "$vsname parsed as [string range $vsname [expr {[string last "/" $vsname]+1}] end]" } } Logs: : /dir1/dir2/myvs parsed as myvs : /Common/myvs parsed as myvs : myvs parsed as myvs
- Opher_Shachar_6Nimbostratus
Thanks Aaron,
As DevCentral notification mail was hitting my "Spam mail", I've not seen your former post (from 02/29/2012) and just now seen your last post. I've actually came up with a terser form:
Don't know how fast (or slow) this is ... but it's more pleasant to the eye of my iRule unversed colleague who also supports the ltm. Regards, Opher.set vname [URI::basename [virtual name]]
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