Forum Discussion
DarkSideOfTheQ_
Nimbostratus
Jan 23, 2009irule to return status code
I'm still learning here, so bear with me. I am trying to write an irule that will catch requests trying to pull content from a specific set of hosts (ex. myserver1.domain.com, myserver2.domain.com, myserver3.domain.com) and return a 200 status code.
Here is what I have put together, but I'm not sure what I have wrong.
when HTTP_REQUEST {
if { [HTTP::uri]} contains 'myserver' [HTTP::respond 200]
}
TIA,
DarkSide
- dennypayne
Employee
Hi, - Colin_Walker_12Historic F5 AccountDenny's right, so what you'd want instead is something like:
when HTTP_REQUEST { switch -glob [HTTP::host] { "*myserver1.domain.com" - "*myserver2.domain.com" - "*myserver3.domain.com" { HTTP::respond 200 content "Response from LTM iRule" } } }
- DarkSideOfTheQ_
Nimbostratus
You guys are awesome, thanks a bunch. Course, now I've realized I was totally off-base with what I had put together. Is there a good link (maybe the wiki one you provided Colin) that will help me learn the irule syntax that is available in these devices? I know it's TCL based (which I don't know and must learn now), but read that not all TCL commands are implemented. - DarkSideOfTheQ_
Nimbostratus
nm...if i had bothered to look at the "Spotlight Wikis" links, I would have found what I seek.
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