pedinopa_170325
Aug 07, 2018Nimbostratus
trouble rewiting path
I need to rewrite the REQUEST path that is returned to the browser. I have an irule which reads the REQUEST path, splits it into a variable which has the path I want (I logged it to my logging server so I know it contains what I want. I am having trouble with getting the HTTP::path modified.
First use hsl::open to define where to send logs and save it as a variable HSLwhen CLIENT_ACCEPTED { set hsl [HSL::open -proto UDP -pool graylog2-syslog-pool] }
when HTTP_REQUEST {
create variable to hold modified path, split on ;jsessionidset nojsession [getfield [HTTP::path] ";jsessionid=" 1]
Check if the path contains a jsessionid
if {[HTTP::path] contains ";jsessionid"}{
write to log verify that the if clause and the variable are correct
HSL::send $hsl "webmod This is the $nojsession without sessionid"
replace the path with the variable (modified path without jsessionid)
HTTP::path $nojsession
}
}