Forum Discussion

Robert_47833's avatar
Robert_47833
Icon for Altostratus rankAltostratus
Feb 13, 2014

[LB::server pool] in V11

Hi,team output of COMMAND [LB::server pool] in V11 is /Common/pool-name

 

is there one way to get only pool-name and this command also can be applied in v10 to get only pool-name

 

2 Replies

  • I'm sure someone will come up with a more elegant solution but this should work...

    [string range [LB::server pool] [expr [string last / [LB::server pool]] + 1] [string length [LB::server pool]]]

  • Here are a few other options:

    set mypool "/Common/test_pool"
    
    log local0. [string map {"/Common/" ""} $mypool]
    
    log local0. [getfield $mypool "/" 3]
    
    log local0. [string range $mypool [expr [string last / $mypool] + 1] end]
    
    log local0. [lindex [split $mypool "/"] 2]
    

    Oddly, in a quick timing test the two list-based functions seemed to do the best (getfield and lindex/split).