Forum Discussion

Tony_Hobson_189's avatar
Tony_Hobson_189
Icon for Nimbostratus rankNimbostratus
Mar 21, 2017

STREAM::expression Not Replacing Multiple Expresions

Hello - Hope you can help me. I'm using STREAM in an iRule to replace internal server names with external ones using vars and also to change http to https. It works if I using either one of the elements by themselves, but if I put them together in a single STREAM expression, only the http replacement works.

Here is the iRule:

when CLIENT_ACCEPTED {
  set sINTERNAL_URL "internal.server"
  set sEXTERNAL_URL "external.com"
}

when HTTP_REQUEST { 
  STREAM::disable 
 } 

when HTTP_RESPONSE { 
  if { [HTTP::header Content-Type] starts_with "text/" }{ 
    STREAM::expression "@://${sINTERNAL_URL}@://${sEXTERNAL_URL}@ @http://@https://@" 
    STREAM::enable 
  } 
}

Any ideas?

Thanks

  • '://' was matching on both.

    Try this:

    STREAM::expression "@${sINTERNAL_URL}@${sEXTERNAL_URL}@ @http://@https://@"  
    
  • '://' was matching on both.

    Try this:

    STREAM::expression "@${sINTERNAL_URL}@${sEXTERNAL_URL}@ @http://@https://@"  
    
  • kunjan's avatar
    kunjan
    Icon for Nimbostratus rankNimbostratus

    '://' was matching on both.

    Try this:

    STREAM::expression "@${sINTERNAL_URL}@${sEXTERNAL_URL}@ @http://@https://@"