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...
Brad_Parker
Cirrus
Oct 19, 2015Give this a try:
when HTTP_REQUEST {
Look for a URI If found send back an HTTP 200
if { [HTTP::uri] equals "/about/health/status" } {
Send a 200 response with data
HTTP::respond 200 "X-Responce" "TestOk for client [getfield [IP::client_addr] {%} 1]"
}
else {
drop
}
}
- Tyler_Brown_949Oct 19, 2015
Nimbostratus
Thanks for the quick response Brad, I'll give that a try. I just got it working with the following as well. when CLIENT_ACCEPTED { if {[active_members client-443-pool-01] < 1}{ reject } } when HTTP_REQUEST { Look for a URI If found send back an HTTP 200 if { [HTTP::uri] equals "/about/health/status" } { Send a 200 response with data HTTP::respond 200 "X-PublicIP" "[IP::client_addr]" "X-Responce" "TestOk" } else { drop } }
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