Forum Discussion
Add iRule to all VIPs?
I have created the following irule:
when HTTP_REQUEST { if { [HTTP::header "User-Agent"] contains "Baiduspider" } { drop return } }
However I need to add it to 300 different vips. Is it possible to do this through tmsh? I tried modify but from what I understand that will remove all current irules on that vip.
3 Replies
- hoolio
Cirrostratus
Hi Philip,
Which LTM version are you running? I think you'll need to write a tmsh script which only attempts to add the iRule to virtual servers with an HTTP profile.
You could start with Jason's config search example to get a list of virtual servers with an HTTP profile:
https://devcentral.f5.com/wiki/tmsh.codeshare.ashx -> https://devcentral.f5.com/wiki/TMSH.ConfigSearch.ashx
Aaron - Philip_L
Nimbostratus
Hi Aaron,
My mistake. I am running 11.1. I was hoping it was a onw line command which already existed on the file system. I might just modify this:https://devcentral.f5.com/wiki/TMSH.RemoveIRuleFromMultipleVS.ashx to add the irule. Thanks for your reply - B_Earp
Altocumulus
I'm running 11.6 now and still no update to this. I ended up using the F5 iRule editor - you right click the iRule and select Properties - you can then select or deselect the VS that are using the iRule.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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