Forum Discussion
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
- Hannes_Rapp
Nimbostratus
Hi Jürgen,
Can you share your HTTP_RESPONSE events of both iRules?
- gamm_31377
Nimbostratus
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*} - Hannes_Rapp_162
Nacreous
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
Nacreous
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.
- Hannes_Rapp
Nimbostratus
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
Nimbostratus
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.
- gamm_31377
Nimbostratus
Thanks a lot ! I think the splitting with the \ helps to structure the iRule.
Jürgen
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com