Forum Discussion
willsweeper_131
Nimbostratus
Mar 04, 2014Add an iRule to multiple virtual servers
I am looking for a script to add/apply an irule to a list of virtual servers, or virtual servers that contain "www" in the name.
Thanks.
Kevin_Stewart
Employee
Mar 04, 2014Try this Bash script:
!/bin/bash
for virtual in `tmsh list /ltm virtual one-line |awk -F" " '{ print $3 }' |grep www`; do
tmsh modify /ltm virtual $virtual rules { test-rule }
done
If you do:
grep ^www
That'll grab virtual servers that start with www, and if you leave the grep off completely it'll give you all of the virtual servers.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects