Forum Discussion
Kevin_Stewart
Sep 09, 2013Employee
I didn't test this against an Oracle environment, but the following should get you closer:
when CLIENT_ACCEPTED {
TCP::collect
}
when CLIENT_DATA {
set sid_match 0
if { [TCP::payload] contains "CONNECT_DATA=" } {
set sid_match 1
log local0. "original payload = [TCP::payload]"
set service_name "SERVICE_NAME=MYSERVICENAME"
if { [regsub -all -nocase "SID=MYSID" [TCP::payload] "$service_name" newdata] } {
TCP::payload replace 0 [TCP::payload length] ""
TCP::payload replace 0 0 $newdata
log local0. "replaced payload = $newdata"
}
}
TCP::release
TCP::collect
}
You'll need to re-add your pool logic, but you shouldn't have to do any of the payload length manipulation. Output from test using an HTTP POST:
original payload = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.11.110.10)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SID=MYSID)(CID=(PROGRAM=sqlplus)(HOST=xxxxxxx)(USER=xxxxxx))))
replaced payload = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.11.110.10)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MYSERVICENAME)(CID=(PROGRAM=sqlplus)(HOST=xxxxxxx)(USER=xxxxxx))))