Forum Discussion

mike_108881's avatar
mike_108881
Icon for Nimbostratus rankNimbostratus
Jan 08, 2010

stream::expression just won't work

I'm running 9.4.6 and trying the most basic stream replacement possible. I have set the default stream profile on the virtual server and am trying to use an iRule to do a replacement:

 

 

when HTTP_RESPONSE {

 

 

Disable the stream filter by default

 

STREAM::disable

 

 

Check if response type is text

 

if {[HTTP::header value Content-Type] contains "text"}{

 

 

STREAM::expression "@test@blah@"

 

 

STREAM::enable

 

}

 

}

 

 

The response body contains "This is a test"

 

 

I did some logging and it does not find a match for "test". Occasionally it will find a match when I use a single letter, and sometimes it messes up the response so I get page cannot be displayed. I've never got it to find a match with more than one letter as the target text.

 

 

There has to be something obvious I'm missing here. Any help is appreciated.

4 Replies

  • I haven't messed with stream replacement in an iRule before mike, but the examples I have seen don't use quotation marks around @test@blah@

     

     

    You may have already seen this post, but I wanted to point it out to you because it is a very good example and might steer you in the right direction:

     

     

    http://devcentral.f5.com/Default.aspx?tabid=53&forumid=5&postid=790760&view=topic

     

     

  • Thanks for the link. I've read through that. The thing is I'm doing this exactly like every example I've seen but it just doesn't do anything.

     

     

    And I have tried "@test@blah@", @test@blah, and {@test@blah@} since I've seen all three used in different examples. It doesn't change the result.

     

     

    Thanks
  • Is the response payload compressed? LTM won't decompress the the response content, so you need to disable compression on the servers or remove the Accept-Encoding header from the request.

     

     

    Aaron
  • Thanks Aaron, that was it. IIS was set to compress the response. Apparently this is the default setting for web sites within IIS 7.5.

     

     

    Rather than adding another configuration change that needs to be made any time we add or re-build servers in our SharePoint farm, I think the better approach would be to just remove the Accept-Encoding header on the request.

     

     

    Thanks again!