Forum Discussion
Tyler_Brown_949
Nimbostratus
Oct 19, 2015iRule to Extract and Repsond back with client IP
All,
I've got the following iRule setup that's being used as a health check for some of our clients. Right now the text we reply back with is a basic static value "TestOk". I'm wondering if its...
Kevin_Stewart
Employee
Oct 19, 2015I assume you understand that "X-Response" will be returned to the client as an HTTP header. If you want the data to be present in the HTTP payload you'd use the "Content" tag:
when HTTP_REQUEST {
if { [HTTP::uri] equals "/about/health/status" } {
HTTP::respond 200 Content "TestOK"
}
}
As far as the data that you send back, that can come from any values presented in the client's request and potentially a wealth of server side information. For example, to send the client's IP back:
when HTTP_REQUEST {
if { [HTTP::uri] equals "/about/health/status" } {
HTTP::respond 200 X-Response "TestOK: [IP::client_addr]"
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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