Forum Discussion
create IRule in tmsh
Wally, this loads for me on 11.4.1 HF3
tmsh create ltm rule /Common/my_rule_rule when HTTP_REQUEST { if { [class match [HTTP::uri] contains this_uri] } { pool my_test_pool_1 } else { pool my_test_pool_2 }}
Removed the "{" between rule name and when statement and corresponding "}" at the end.
Couple other notes: - Double quotes require backslash delimiter, i.e., if { [HTTP::host] starts_with \"myhost\"} - Linefeeds require backslash delimiter, if using LF for clarity, i.e., tmsh create /ltm rule test_rule \ when HTTP_REQUEST {\ if { [HTTP::host] starts_with \"myhost\" } } else {\ discard\ }\ }
We use scripts for change control and create (most)everything at the console. Hope this helps.
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
