DifanZ
Jul 13, 2021Cirrus
irule for extracting a string from a URI
Hi experts,
I am new to irule and it doesn't look like I am allowed much time to learn it properly... In short, they want me to redirect to a URL when all the members in the pool are down. The problem is that the redirect URL will need some data from the original URL.
Original -> http://ecmqut.network.qut/ecmlivelink/llisapi.dll/open/168812040
Redirect to -> http://csintqut.network.qut:81/fsl/Redirect.aspx?docid=168812040
As you can see, the number string is what I need to extract from the original URL. Here is my irule (that's not working)
when HTTP_REQUEST {
if { [active_members livelink_qut_tcp_8100_pool] < 1 } {
set doc_id [regexp \\/open\\/\(\\d+\)\[0-9\] [HTTP::uri] ]
# HTTP::redirect "http://outagemessage-qut.network.qut/"
log local0. “http://csintqut.network.qut:81/fsl/Redirect.aspx?docid=$doc_id”
}
}
As you can see, I am not even redirecting right now. I am just logging it to make sure it comes out right and it doesn't... I am getting error like
http_process_state_prepend - Invalid action:0x109010 Server sends too much data. serverside
Please help...
Thanks,
Difan