Forum Discussion
Mick39_201768
Nimbostratus
May 22, 2015How to add iRules using CLI
Hi, team,
I'm looking for the command to add iRule, since I have to apply about 40 same iRule to Virtual servers.
I tried command which I learned from Q&A below, but it delete current iRules. ...
Nandhini_Natara
Nimbostratus
Mar 07, 2019You can automate the irule addition to the Virtual server with the below scripts. Create a file virtual_list and paste all the virtual servers for which you need to add the new irule.
!bin/bash
for i in $(cat virtual_list)
do
rule=`tmsh list ltm virtual $i rules | egrep -v "\{|\}"`
echo "irule is ${rule//[[:blank:]]/} and virtual is $i"
modify ltm virtual $i rules { ${rule//[[:blank:]]/} new-irule-name }
echo " rule added successfully "
done
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