Forum Discussion
Checking what iRules are associated to multiple virtual servers
I need to understand what iRules are configured under each virtual server in a certain partition on my LTM and then extract the iRule configuration. Is there a quicker way to do this rather than manually checking each virtual server?
Hello.
Try this ->
tmsh -q -c "cd / ; list ltm virtual recursive one-line" | grep rule
KR,
Dario.
- Lee_SutcliffeNacreous
not really, but it can be a bit easier from the command line and using a good text editor and maybe a bit of regex if you're feeling adventurous.
Hello.
Try this ->
tmsh -q -c "cd / ; list ltm virtual recursive one-line" | grep rule
KR,
Dario.
- harhanNimbostratus
I wanted to expand a bit on the answer, as this question comes up once in a while. The one-line argument is a bit hard to read if you want to scan over the rules by hand. I expanded the above expression with sed in stead.
It will list all virtual servers, regardless if they use irules or not.
tmsh -q -c "cd / ; list ltm virtual recursive" | sed -n -e '/ltm virtual/p' -e '/ rules/,/}/p'
The second sed expression scans the lines from rules to } outputting something similar to:
ltm virtual Common/VS_Test { ltm virtual Common/VS_FrontEnd { rules { Common/iRule_FrontEnd }
Edit: slight change in sed expression
- s_selveyNimbostratus
Thanks Dario, this works perfectly. Managed to get "list ltm virtual | grep irule", but didn't know how to get the previous lines output!
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