Forum Discussion
wtwagon_99154
Nimbostratus
Oct 27, 2009Custom HTTP Monitor looking for String Response
I am wondering if it is possible to perform a custom HTTP Monitor to receive a string response.
We have a specific application that will return a 0 or a 1 on the request. 0 = good, 1 =...
krelm_52303
Nimbostratus
Nov 24, 2008Here's a version that is working for us (changing the Request Host header and URI), but hoping there's an easier way to modify the URI?
when HTTP_REQUEST {
Check if host value has a colon
if {[HTTP::host] contains ":"}{
log local0. "URI: [HTTP::uri]"
set find ":55555"
set replace ""
set uri_old [HTTP::uri]
regsub -all $find $uri_old $replace new_uri
HTTP::uri $new_uri
log local0. "NEW URI: [HTTP::uri]"
Replace host header value with everything before the colon
set new_host [getfield [HTTP::host] ":" 1]
HTTP::header replace "Host" $new_host
log local0. "[IP::client_addr]:[TCP::client_port]: Replace original host [HTTP::host] with [getfield [HTTP::host] ":" 1]"
}
}
Also, as you suggest, it looks like we'll need to modify the HTTP_Response Location header + any other references to objects in the HTTP_Response payload. May need to look at this...
http://devcentral.f5.com/weblogs/Joe/archive/2005/07/27/1398.aspx
Cheers.
- Ken_Reypens_200May 11, 2015
Nimbostratus
Can somembody send me the link to the iApp? I would like to download an test the iApp but I can find where to download, tx for helping me out. - Nikoolayy1Jul 07, 2022
MVP
Better repost the irule (F5 has moved from iApp templates to FAST templates) as F5 for some reason still have not added native sql proxy support and maybe this irule can be modified for MS SQL because F5 does no longer supports it.
- LiefZimmermanJul 08, 2022
Admin
Thanks Nikoolayy1 - we'll take a look. Seems this old /wiki/ reference is still hanging around.
JRahm - is there a way to un-ravel this? Would not recommend trying to do this in an iRule unless you want to modify with every version of mysql that is released. There was a solution, yes, but it was highly tuned for specific version and brittle at that. Would highly recommend a 3rd party solution to integrate.