Forum Discussion
TMSH command to add irule
- Aug 22, 2019
You don't need to write a shell script, you can use the 'edit' feature in tmsh.
For example, if you wanted to add an iRule to all of your virtual servers you could do the following
tmsh edit ltm virtual all
This bring up the vim editor, so you can use find and replace to add a new iRule to all your virtual servers with one line
:%s/rules {/rules {\r\tnew-irule/g
You don't need to write a shell script, you can use the 'edit' feature in tmsh.
For example, if you wanted to add an iRule to all of your virtual servers you could do the following
tmsh edit ltm virtual all
This bring up the vim editor, so you can use find and replace to add a new iRule to all your virtual servers with one line
:%s/rules {/rules {\r\tnew-irule/g
- bjorg235Aug 22, 2019Altocumulus
Thank you so much ..It worked..could you help to place the irule in the last. With the above I am getting irrule in the first
- Lee_SutcliffeAug 22, 2019Nacreous
If I were you, I wouldn't rely on ordering your iRules on the virtual server.
Instead, use iRule priority so they are executed in the order you require eg
rule my-first-irule { when HTTP_REQUEST priority 10 { #this will run first } }
rule my-second-irule { when HTTP_REQUEST priority 20 { #this will run second } }
- Angryman808Oct 13, 2023Nimbostratus
This is genius, would you be able to write similar code to remove an iRule from all virtual servers as well?
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