Forum Discussion
BMARTIN_12200
Nimbostratus
Dec 15, 2008Add Ip member pool in my header browser
Hello, my application is spread over 24 servers JBOSS cluster of 6 pools of 4 members. To facilitate maintenance I would like to appear in the title of the browser the IP address of the member on whic...
BMARTIN_12200
Nimbostratus
Dec 16, 2008I set the logs in the example of jquinby.
I see an error when running the command HTTP::payload replace. Below errors and attached the log
Dec 16 16:22:49 tmm tmm[1537]: 01220001:3: TCL error: Rule irule_set_ip_member_pool_in_title_browser
- Out of bounds (line 1) invoked from within "HTTP::payload replace 0 $content_length $newdata "
and
Dec 16 16:22:49 tmm tmm[1537]: 01220001:3: TCL error: Rule irule_set_ip_member_pool_in_title_browser
- Out of bounds (line 1) invoked from within "HTTP::payload replace 0 $content_length $newdata "
when HTTP_REQUEST {
Don't allow data to be chunked - override whatever the
browser has told us.
if { [HTTP::version] eq "1.1" } {
if { [HTTP::header is_keepalive] } {
HTTP::header replace "Connection" "Keep-Alive"
}
HTTP::version "1.0"
}
}
when HTTP_RESPONSE {
if we know how much we're getting back, grab it all. If
we don't know how much we're getting back, grab an arbitrarily
long chunk of data that ought to get it all.
if { [HTTP::header Content-Type] starts_with "text/html" } {
if { [HTTP::header exists "Content-Length"] } {
set content_length [HTTP::header "Content-Length"]
} else {
set content_length 1000000000
}
if { $content_length > 0 } {
HTTP::collect lets us manipulate the data via the next stanza
below.
HTTP::collect $content_length
log local0. "CONTENT_LENGTH: $content_length"
}
}
}
when HTTP_RESPONSE_DATA {
and now the payoff - a regex substitution of the opening title tag
with the tag + the value contained in IP::server_addr. Additional text
could be added as well.
regsub -all "" [HTTP::payload] " [IP::server_addr] " newdata
log local0. "NEWDATA: $newdata"
log local0. "PAYLOAD: [HTTP::payload]"
HTTP::payload replace 0 $content_length $newdata
HTTP::release
}
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