Forum Discussion
list pools by name
Hello, how can I list the names of all pools containing let's say "qa" in their name. Thanks!
- rob_carrCirrostratus
This script handles multiple partitions and can have it's output piped to a file for further analysis:
tmsh -q -c 'cd /;show running-config recursive'|awk '/^ltm pool /{capture=1}/^}$/{if (capture==1) {print; capture=0} else {next}}capture' | grep 'ltm pool\|monitor '
You can also run it against an SCF file, by removing the initial tmsh clause and providing the awk expression with an scf file to read.
- mariana_kirova_Nimbostratus
I found following in previously asked questions but doesn't seem to work for me:
(tmos)list ltm pool all | grep 'ltm pool|qa'
- gdoyleCirrostratus
tmsh cd / list ltm pool | grep qa
- AceDawg1Nimbostratus
From the command line, this works as well if you just want the names of the pools:
tmsh list ltm pool | grep "qa" | gawk '{print $3}'
The following will list out all of the pool names on your system:
tmsh list ltm pool | grep "ltm pool" | gawk '{print $3}'
- gdoyleCirrostratus
The
command doesn't seem to work for my (I received the following:gawk
).Syntax Error: "gawk", grep is currently the only filter that is supported
Also, if you have multiple partitions you will have to change your directory into the relevant partition. There may be a way to do a global search for all partitions, but I don't know that off hand.
- AceDawg1Nimbostratus
Gawk can be executed if you are not in the tmsh shell. You have to be in the bash shell.
For partition support, use:
tmsh list ltm pool /partition/* | grep “ltm pool” | gawk ‘{print $3}’
From the command line, this works as well if you just want the names of the pools:
tmsh list ltm pool | grep "qa" | gawk '{print $3}'
The following will list out all of the pool names on your system:
tmsh list ltm pool | grep "ltm pool" | gawk '{print $3}'
- gdoyleCirrostratus
The
command doesn't seem to work for my (I received the following:gawk
).Syntax Error: "gawk", grep is currently the only filter that is supported
Also, if you have multiple partitions you will have to change your directory into the relevant partition. There may be a way to do a global search for all partitions, but I don't know that off hand.
Gawk can be executed if you are not in the tmsh shell. You have to be in the bash shell.
For partition support, use:
tmsh list ltm pool /partition/* | grep “ltm pool” | gawk ‘{print $3}’
- wlopez_98779Nimbostratus
From tmsh:
For pools on the default partition (/Common):
list ltm pool | grep qa
For pools on all other partitions:
list ltm pool /*/* | grep qa
- mariana_kirova_Nimbostratus
works great, thanks!tmsh list ltm pool | grep "ltm pool" | gawk '{print $3}'
This one however doesn't work well when I am matching something that is part of the pool's settings (for example "user" is being matched by
) so it will display all my pools:session user-disabled
(tmos) list ltm pool | grep user
Display all 1253 items? (y/n) n
- wlopez_98779Nimbostratus
This would give you all the properties for all pools and filter for only the lines that include the pool names and the lines where the string 'user' shows up in the configuration.
From tmsh:
For pools on the default partition (/Common):
list ltm pool all-properties | grep 'ltm pool\|user'
For pools on all other partitions:
list ltm pool /*/* all-properties | grep 'ltm pool\|user'
- wlopezCirrocumulus
From tmsh:
For pools on the default partition (/Common):
list ltm pool | grep qa
For pools on all other partitions:
list ltm pool /*/* | grep qa
- mariana_kirova_Nimbostratus
works great, thanks!tmsh list ltm pool | grep "ltm pool" | gawk '{print $3}'
This one however doesn't work well when I am matching something that is part of the pool's settings (for example "user" is being matched by
) so it will display all my pools:session user-disabled
(tmos) list ltm pool | grep user
Display all 1253 items? (y/n) n
- wlopezCirrocumulus
This would give you all the properties for all pools and filter for only the lines that include the pool names and the lines where the string 'user' shows up in the configuration.
From tmsh:
For pools on the default partition (/Common):
list ltm pool all-properties | grep 'ltm pool\|user'
For pools on all other partitions:
list ltm pool /*/* all-properties | grep 'ltm pool\|user'
- jurgenvdmark_14Nimbostratus
You can also use the sed command to get the info directly from the bigip.conf files of the different partitions.
Try the below command
sed -n '/^ltm pool/p' /config/bigip.conf /config/partitions/*/bigip.conf | awk '{ print $3 }'
Recent Discussions
Related Content
* 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