Forum Discussion

tidenz_92110's avatar
tidenz_92110
Icon for Nimbostratus rankNimbostratus
Feb 08, 2012

Stream Expression

Hi guys,

 

 

having an issue when using a stream profile and expression

 

 

STREAM::expression {@/$TEXT/static-@https://abc/$TEXT/static@ @\.\./static@https://abc/static@}

 

 

so if i use the above then second pair works but the variables replace doesnt in the first pair

 

 

Now i know if i use curly braces then the variable wont work but if i go the other way so use quotes "" instead then the second pair breaks.

 

 

STREAM::expression "@/$TEXT/static-@https://abc/$TEXT/static@ @\.\./static@https://abc/static@"

 

 

is there a way to use both without causing an issue?

 

 

Thanks

 

  • Now i know if i use curly braces then the variable wont work but if i go the other way so use quotes "" instead then the second pair breaks.what was broken?

    this is mine.

    [root@ve1023:Active] config  b virtual bar list
    virtual bar {
       snat automap
       pool foo
       destination 172.28.19.79:80
       ip protocol 6
       rules myrule
       profiles {
          http {}
          stream {}
          tcp {}
       }
    }
    [root@ve1023:Active] config  b pool foo list
    pool foo {
       members 200.200.200.101:80 {}
    }
    [root@ve1023:Active] config  b rule myrule list
    rule myrule {
       when HTTP_REQUEST {
       STREAM::disable
       HTTP::header remove "Accept-Encoding"
    }
    when HTTP_RESPONSE {
       set TEXT "test"
       if {[HTTP::header value Content-Type] contains "text"}{
          STREAM::expression "@/$TEXT/static-@https://abc/$TEXT/static@ @\.\./static@https://abc/static@"
          STREAM::enable
       }
    }
    }
    
    [root@ve1023:Active] config  curl http://200.200.200.101/test.html
    ...
    this is host 101.
    ...
    /test/static-abc
    ../staticabc
    ...
    
    [root@ve1023:Active] config  curl http://172.28.19.79/test.html
    ...
    this is host 101.
    ...
    https://abc/test/staticabc
    https://abc/staticabc
    ...