Forum Discussion
Kai_Wilke
Feb 08, 2017MVP
Hi Brad,
Performance-wise it's slightly more effective to integrate the HSL command into the existing iRule. In this case your F5 doesn't need to parse the HTTP::path twice to check if
/audit*
is requested.
Management-wise its up to you. Both approaches are absolute valid...
The integration of HSL is rather simple. You may take a look to the iRule below to see how the HSL can be integrated in your existing iRule.
when CLIENT_ACCEPTED {
set hsl_handle [HSL::open -proto -pool ]
}
when HTTP_REQUEST {
set context_root "/audit"
if { [HTTP::path] starts_with $context_root } {
HSL::send $hsl_handle "<135> Audit access: [IP::client_addr]\n"
switch [HTTP::path] {
"/audit" {
HTTP::uri "/?[HTTP::query]"
HTTP::path "/"
}
default {
set substr_uri [substr [HTTP::uri] [string length $context_root]]
set substr_path [substr [HTTP::path] [string length $context_root]]
HTTP::uri $substr_uri
HTTP::path $substr_path
}
}
}
}
Cheers, Kai