Forum Discussion
danra_139044
Apr 30, 2014Altostratus
Add irule via tmsh without deleting existing irules, and how to re-order
In v11.5 - need assistance in adding irules via tmsh, without deleting existing irules.
tmsh modify /ltm virtual rules { irulename } this removes all the applied irules and only adds the new i...
Kevin_Stewart
May 02, 2014Employee
Okay, this is wildly simplistic, but take a look:
!/bin/bash
current_rules=`tmsh list ltm virtual $1 one-line all-properties |perl -ne 'print "$1" if /rules {(.*?)}/'`
tmsh modify ltm virtual $1 rules { $current_rules $2 }
There's no error checking here, so you'd need to add it. The above takes the VIP name as the first param ($1) and the new iRule as the second ($2). The first line extracts the current iRules form the given VIP into a variable, and then adds them back in with the second line.
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