Forum Discussion

gamm_31377's avatar
gamm_31377
Icon for Nimbostratus rankNimbostratus
Jun 26, 2015

multiple iRules and stream profile

Hello

 

I have 2 iRules bound to 1 Virtual Server. Each of this iRules should make modifications on the HTTP_RESPONSE(HTML payload) from the server using a stream profile. But only the iRule from the first position of the list is working. If I change the order the 2. iRule is working.

 

I know I can put them into one iRule, but the irules are covering different aspects and the pattern string is very long. Are there any restrictions regarding the stream profile ?

 

Thanks Jürgen

 

7 Replies

  • Hi Jürgen,

     

    Can you share your HTTP_RESPONSE events of both iRules?

     

  • Thanks for the response. Here are both events:

    Thanks Jürgen

    when HTTP_RESPONSE {

        Check if server response is text based
       if { [HTTP::header Content-Type] contains "text" }{
    
        make the things invisible
       STREAM::expression {@id="presence"@id="presence" style="display: none;"@ @id="mainTitle_presence"@id="mainTitle_presence" style="display: none;"@ @id="prsPrefs"@id="prsPrefs" style="display: none;"@} 
    
       STREAM::enable
       }
    

    }

    when HTTP_RESPONSE {

        Check if server response is text based
       if { [HTTP::header Content-Type] contains "html" }{
    
          STREAM::expression {@\r\n\s*\r\n\s*
    
    
    }
  • Indeed, you will have to all your stream expressions in the same IF condition. What may help you is if you use the backslash symbol to split a single long expression to two/three/four lines. Also the comparison against "text" Content-Type should work for both, since "text/html" are usually together 🙂

     STREAM::expression { \
       @id="presence"@id="presence" style="display: none;"@ @id="mainTitle_presence"@id="mainTitle_presence" style="display: none;"@ @id="prsPrefs"@id="prsPrefs" style="display: none;"@ @ \
       \r\n\s*\r\n\s*
    • Hannes_Rapp_162's avatar
      Hannes_Rapp_162
      Icon for Nacreous rankNacreous
      Would replace the first sentence, if only DevCentral would let me do that. Indeed, you will have to call all your stream expressions in the same IF condition, assuming what you want is both of them to trigger on a single GET request.
  • Indeed, you will have to all your stream expressions in the same IF condition. What may help you is if you use the backslash symbol to split a single long expression to two/three/four lines. Also the comparison against "text" Content-Type should work for both, since "text/html" are usually together 🙂

     STREAM::expression { \
       @id="presence"@id="presence" style="display: none;"@ @id="mainTitle_presence"@id="mainTitle_presence" style="display: none;"@ @id="prsPrefs"@id="prsPrefs" style="display: none;"@ @ \
       \r\n\s*\r\n\s*
    • Hannes_Rapp's avatar
      Hannes_Rapp
      Icon for Nimbostratus rankNimbostratus
      Would replace the first sentence, if only DevCentral would let me do that. Indeed, you will have to call all your stream expressions in the same IF condition, assuming what you want is both of them to trigger on a single GET request.
  • Thanks a lot ! I think the splitting with the \ helps to structure the iRule.

     

    Jürgen