Forum Discussion

Squeak's avatar
Squeak
Icon for Cirrus rankCirrus
Feb 03, 2021
Solved

Multiple stream replacements using an iRule

Hi,

I´ve an Irule that scans for two expressions, supportportalen-test and web02 and adds a full FQDN instead of the shortname.

when HTTP_REQUEST {
   # Explicitly disable the stream profile for each request so it doesn’t stay
   # enabled for subsequent HTTP requests on the same TCP connection.
   STREAM::disable
   HTTP::header remove "Accept-Encoding"
}
 
when HTTP_RESPONSE {
   # Apply stream profile against text responses from the application
   if { [HTTP::header value Content-Type] contains "text"} {
   
      STREAM::expression {@http://supportportalen-test/@http://supportportalen-test.hej.se/@@http://web02/@http:/web02.hej.se/@}
 
      # Enable the stream profile
      STREAM::enable
  }
}

My issue are that the Irule only adds the full FQDN on supportportalen-test but not on web02.

I found this https://devcentral.f5.com/s/articles/ltm-stream-profile-multiple-replacements--regular-expressions the syntax on the stream expression in the link seems to be correct but it still not works.

Any takes?

//Mikael

2 Replies

    • Squeak's avatar
      Squeak
      Icon for Cirrus rankCirrus

      Hi,

       

      Yes, your code worked with a slight modification. I had to remove the spaces between

      "{ @" and "@ }"

       

      From your link.

      Note that the stream-expression string must not begin or end with blank space. Erroneous spaces will not provoke error messages but will prevent matching any data.

      But thanks for your help.

       

      //Mikael