Forum Discussion

PatPerron_18894's avatar
PatPerron_18894
Icon for Nimbostratus rankNimbostratus
Jun 01, 2015

tmsh list by description

Hi,

 

I'm looking for an option in command line (tmsh) to list all virtual servers with a specific description. Do I have to script something is there an existing tmsh options to do it?

 

Thanks

 

Pat

 

5 Replies

  • tmsh list ltm virtual all | grep 'specific description'

     

    should do the work...

     

  • While it's not my own answer (taken and modified from and answer on this question), this may help with that you're looking for..

    • This would give you any virtual matching that description
      tmsh list ltm virtual | grep ''
      (it's not the prettiest output but it gives you the whole config for that virtual)
    • This would give you the virtual name and description line:
      tmsh list ltm virtual | awk '/(ltm virtual|)/' | grep -B1 ""
    • This would give you a slightly cleaner version of the previous one
      tmsh list ltm virtual | awk '/(ltm virtual|)/' | grep -B1 "" | sed -e 's/{//g;s/--//g;s/\n//g'
  • Hi,

     

    So the answer is no, is there no tmsh command line to do it.

     

    Thanks for your help, I'll try to get a command line to do what want.

     

    I need to get the complete configuration of all VS with a specific description.

     

    Thanks

     

    Pat

     

  • try this, this should print the VS config for a particular description

     

    tmsh list ltm virtual | awk 'BEGIN {RS="ltm"} /"description"/ {print "ltm"$0}'

     

    cheers