Forum Discussion
TMSH Command to list ASM policies not attached to any virtual servers in all partitions
To list ASM (Application Security Manager) policies that are not attached to any virtual servers in all partitions using TMSH (Traffic Management Shell), you can use the following command:
tmsh -q -c 'cd / ; list asm policy one-line' | awk '!/attached-to/ {print}'Copy
This command works by listing all ASM policies in a one-line format and then using awk to filter out those that are not attached to any virtual servers.
- tmsh -q -c 'cd / ; list asm policy one-line' lists all ASM policies in a concise format.
- awk '!/attached-to/ {print}' filters out the policies that do not have the "attached-to" field, meaning they are not attached to any virtual servers.
- omykhanJan 20, 2025
Altostratus
Hi, Thanks for the response
This command is perfectly working [ tmsh -q -c 'cd / ; list asm policy one-line' ] listing all the ASM policies in a partition, but the other one [ awk '!/attached-to/ {print}'Copy ] is not filtered out the unused policies which are not attached to any VS. It instead outputs all the ASM policies
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