Forum Discussion
Tim_W_72292
Nimbostratus
Oct 24, 2007Irule with Multiple HTTP checks
Hi All,
I am trying to write a rule that will do multiple check within the HTTP headers, is this possible? Here is what I was thinking:
if {[HTTP::host] equals and [HTTP::st...
Tim_W_72292
Nimbostratus
Oct 26, 2007
I have changed this a little after checking out what else I need to do, does it look ok?
when HTTP_REQUEST {
If request is for the message store, set a variable to log the client/server IP's if the response is a 400
if {[HTTP::path] starts_with "/MmscServletApp/DeliveryFailureSyncServlet"}{
set check_response 1
} else {
set check_response 0
}
}
when HTTP_RESPONSE {
If the request was for the message store, check if HTTP response status is a 200
if {$check_response && [HTTP::status] == 400}
log local0. "[IP::client_addr] -> [IP::server_addr] for the login page generated a HTTP 400 response, node will be disabled"
set n [IP::server_addr]
LB::down node $n
} elseif {$check_response && [HTTP::status] not equals 200}
set r [HTTP::status]
log local0. "[IP::client_addr] -> [IP::server_addr] for the login page generated a HTTP $r response"
}
}
Cheers
Tim
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
