Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Virtual servers associated with a specific SNAT pool

Khaled_HA
Altocumulus
Altocumulus

Hi Everyone,

I need your help as I am trying to get the VSs that are associated with a specific SNAT pool from the command line.

 

Thanks!

1 ACCEPTED SOLUTION

JRahm
Community Manager
Community Manager

Hi @Khaled_HA, you can use awk to print only the virtual name, so to expand on what was provided earlier:

tmsh list ltm virtual one-line | grep "pool SNAT_POOL_NAME" | awk '{print $3}'

View solution in original post

7 REPLIES 7

whisperer
Cumulonimbus
Cumulonimbus

Think you may benefit from the following tmsh script: https://community.f5.com/t5/codeshare/config-search/ta-p/277819.

Hope this helps!

JRahm
Community Manager
Community Manager

Love this script, @whisperer ...should be a default install when deploying new BIG-IP boxes...

tmsh list ltm virtual one-line | grep "pool SNAT_POOL_NAME" 

Remark: SNAT_POOL_NAME should not have the same name as an existing LTM pool (and this is a best practice btw)

Hi Amine,

Actually I was using this command, the problem is that it is giving me the whole configuration, while I just need the virtual server name.

So, is there any way to get only the virtual server name ?

Thanks!

JRahm
Community Manager
Community Manager

Hi @Khaled_HA, you can use awk to print only the virtual name, so to expand on what was provided earlier:

tmsh list ltm virtual one-line | grep "pool SNAT_POOL_NAME" | awk '{print $3}'

LiefZimmerman
Community Manager
Community Manager

@Khaled_HA  - If your post was solved it would be helpful to the community to select *Accept As Solution*.
Thanks for being part of our community.

Khaled_HA
Altocumulus
Altocumulus

Thank you guys for the support!!