cancel
Showing results for 
Search instead for 
Did you mean: 
Login & Join the DevCentral Connects Group to watch the Recorded LiveStream (May 12) on Basic iControl Security - show notes included.

How to use Grep command to identify the particular VS with availability status only Available

Bobow
Cirrus
Cirrus

Hi Folks,

 

I want to grep to identify the particular VS with availability status only "Available"

 

I have seen link https://devcentral.f5.com/s/question/0D51T00006i7XWm/how-to-use-grep-command-to-identify-the-particu... and using the below command:

 

tmsh show ltm virtual|grep ^Ltm:: -A5|grep -e 'Ltm::\|\ \ Availability\|\ \ State'

 

but i got all the availability status. My objective is only view VS with Available status.

 

Please help or any advise

 

Thanks in advance

1 ACCEPTED SOLUTION

cjunior
Nacreous
Nacreous

Hi,

You could try this:

tmsh show ltm virtual | grep ": available" -B4 | grep -P "(Ltm::|Availability)"

Regards.

 

View solution in original post

5 REPLIES 5

cjunior
Nacreous
Nacreous

Hi,

You could try this:

tmsh show ltm virtual | grep ": available" -B4 | grep -P "(Ltm::|Availability)"

Regards.

 

Hi Cjunior,

 

Cool, its works! Thank You

Hi Cjunior,

I have another question, did you any advise if i want to grep to identify the particular VS, pool, and node with availability status only "Available" ?

Thanks in advance​

Are you trying to fit default pool members to output?

 If so, add a "detail" statement:

tmsh show ltm virtual detail | grep -P ": (available|unknow)" -B4 | grep -P "(Ltm::|Availability)" |sed -e 's/|//'

To get it from specific virtual server write the name:

tmsh show ltm virtual my_vs_name detail | grep -P ": (available|unknow)" -B4 | grep -P "(Ltm::|Availability)" |sed -e 's/|//'

Regards.

Yes correct is all about default pool and members.

Thank you very much for your answered!

 

Regards