Forum Discussion
harhan
Feb 04, 2020Nimbostratus
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