Forum Discussion
Create iRule from TMOS
I am trying to create an iRule similar to this from TMOS.
when HTTP_REQUEST { HTTP::header replace "Host" "4.2.2.2" }
When I enter the following syntax, I get some type of editor. How can I simply create the iRule in one command?
create rule my_rule when HTTP_REQUEST HTTP::header replace "Host" "4.2.2.2"
2 Replies
- DaleLeBlanc_140
Nimbostratus
I found that this creates the iRule, but only from CLI of the LTM (this works):
tmsh create ltm rule my_rule when HTTP_REQUEST { HTTP::header replace \"Host\" \"4.2.2.2\" }
However, the same command does not work from within TMOS (ltm prompt):
tmsh ltm create rule my_rule when HTTP_REQUEST { HTTP::header replace \"Host\" \"4.2.2.2\" }
Last line causes Syntax Error: Unexpected {
- Michael_Jenkins
Cirrostratus
Are you refering to the TMSH prompt from within the CLI? If so, you may want to try like this:
create ltm rule my_rule "when HTTP_REQUEST { HTTP::header replace \"Host\" \"4.2.2.2\" }"It will probably put you into vi editor to save the file.
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