Forum Discussion
Mike_Graston_10
Nimbostratus
Mar 13, 2007401 response with message and logging
I have a scenerio where I am not sure on how to do this. I would like to filter a uri that contains the string /abc. Any ip address that hits it I would like to log and send back a 401 Unauthorized page to the user and a message that their IP address has been logged as "client IP". Also i would need to know where the log messages go, as you might have figured I haven't worked with logging at all. I don't want to log every IP just the ones that hit this rule, and I don't know if I need to add an elseif statement to continue sending others who don't meet this criteria to the pool or web servers?
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] contains "/abc"} {
HTTP::respond 401
}
}
- JRahm
Admin
log local0. "Client IP is [IP::client_addr]" - Mike_Graston_10
Nimbostratus
So let me get this right, The log will only populate if the condition is met as containing /abc. - JRahm
Admin
Yes you can sho the client that you are logging his IP in the response, check out this thread for specifics-> - Mike_Graston_10
Nimbostratus
OK, not quite there yet,
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