# issue with STREAM macthing

**URL:** <https://community.f5.com/t/issue-with-stream-macthing/49819>\
**Category:** Technical Forums\
**Tags:** deployment, big-ip-access-policy-manager-apm, irules, security, devops, application-delivery\
**Created:** [August 31, 2015, 8:39am UTC](https://community.f5.com/t/issue-with-stream-macthing/49819 "2015-08-31T08:39:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![amolari](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@amolari](https://community.f5.com/u/amolari)\
**Post date:** [August 31, 2015, 8:39am UTC](https://community.f5.com/t/issue-with-stream-macthing/49819/1 "2015-08-31T08:39:22Z")

</div>

hi

trying to have Password Manager Pro working in APM Portal mode. I have such response from server

```tcl
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Strict-Transport-Security: max-age=7776000; includeSubdomains
X-FRAME-OPTIONS: SAMEORIGIN
Cache-Control: no-cache
Content-Type: text/html;charset=UTF-8
Content-Length: 7444
Date: Wed, 26 Aug 2015 15:20:26 GMT

    
[...]
function newRDP(params)
{
    // var w = 1176, h = 551, server_bpp = 16;
    // var w = 1280, h = 780, server_bpp = 16;
    //var w = 1280, h = 610, server_bpp = 16;
    var w = window.innerWidth-10, h = window.innerHeight-10, server_bpp = 16;

    var protocol = ("https:" == location.protocol) ? "wss://" : "ws://";// No I18N
    var r = svManager.getInstance(); 
    params = params + "&mapClipboard=on";//No I18N
    r = new svGlobal.Rdp( protocol + 'pmanagerpro.customer.com'+ ":"+7273+"/RDP?" + params, w, h, server_bpp);// No I18N
    //alert(params + ' ' +w + ' ' +h);
    //console.log(params + ' ' +w + ' ' +h);
[...]

```

want to match

```tcl
'pmanagerpro.customer.com'+ ":"+7273+"/RDP?"

```

Wrote the stream irule

```tcl
when HTTP_REQUEST {
STREAM::disable
HTTP::header remove Accept-Encoding
}

when ACCESS_ACL_ALLOWED {
STREAM::disable
HTTP::header remove Accept-Encoding
}

when HTTP_RESPONSE {

set toreplace "\'pmanagerpro.customer.com\'+ \":\"+7273+\"/RDP?"
set replacestring "\'1.1.1.1/f5-w-68747xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx$$/RDP?\'"
STREAM::disable

if {[HTTP::header Content-Type] contains "text"}{     
   STREAM::expression "@$toreplace@$replacestring@"
    STREAM::enable
log local0. "string1= $toreplace &&&&& string2= $replacestring"
}
}

```

when enabled, the logging shows the

```tcl
toreplace

```

variable be exactly what I want to match. But the match doesn’t work (client gets the original content)

Thank you

Alex

---

<div class="post-metadata">

**Author:** ![EmBee\_57573](https://avatars.discourse-cdn.com/v4/letter/e/b5e925/32.png) [@EmBee\_57573](https://community.f5.com/u/EmBee_57573)\
**Post date:** [August 31, 2015, 10:36am UTC](https://community.f5.com/t/issue-with-stream-macthing/49819/2 "2015-08-31T10:36:55Z")

</div>

see the issue [https://devcentral.f5.com/questions/irule-tcl-error-when-trying-to-invoke-stream-expression](https://devcentral.f5.com/questions/irule-tcl-error-when-trying-to-invoke-stream-expression)

---

<div class="post-metadata">

**Author:** ![amolari](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@amolari](https://community.f5.com/u/amolari)\
**Post date:** [September 14, 2015, 11:14am UTC](https://community.f5.com/t/issue-with-stream-macthing/49819/3 "2015-09-14T11:14:58Z")

</div>

Issue was that STREAM is not effective when using portal mode (rewrite content). Had to use

> **[DevCentral - An F5 Technical Community](https://community.f5.com/)**
>
> DevCentral is an online technical community where engineers and practitioners collaborate, share knowledge, and solve problems related to F5 technologies and industry trends.

> **[DevCentral - An F5 Technical Community](https://community.f5.com/)**
>
> DevCentral is an online technical community where engineers and practitioners collaborate, share knowledge, and solve problems related to F5 technologies and industry trends.

Alex
