Forum Discussion

sam_kal's avatar
sam_kal
Icon for Altostratus rankAltostratus
Apr 26, 2021
Solved

IRule to select IRule doesn't work even if the condition triggers

Problem Statement:

Trying to create a I-Rule to forward traffic to a pool "pool-troubleshooting" in case a header is passed in a request, the "if" condition triggers as the logs are part of the loop but still the traffic goes to the default pool at Virtual server.

BIG-IP 14.1.2

 

IRule:

 

when HTTP_REQUEST {

 if { [HTTP::header exists testing] } {

      pool pool-troubleshooting

           foreach aHeader [HTTP::header names] {

               log local0. "Redirecting to troubleshooting pool HTTP REQUEST HEADER $aHeader: [HTTP::header value $aHeader]"

               }

       }

}

 

 

Logs:

 

 Rule troubleshooting-pool <HTTP_REQUEST>: Redirecting to troubleshooting pool HTTP REQUEST HEADER Host: example.com

 Rule troubleshooting-pool <HTTP_REQUEST>: Redirecting to troubleshooting pool HTTP REQUEST HEADER User-Agent: curl/7.68.0

 Rule troubleshooting-pool <HTTP_REQUEST>: Redirecting to troubleshooting pool HTTP REQUEST HEADER Accept: */*

 Rule troubleshooting-pool <HTTP_REQUEST>: Redirecting to troubleshooting pool HTTP REQUEST HEADER testing: True

 Rule troubleshooting-pool <HTTP_REQUEST>: Redirecting to troubleshooting pool HTTP REQUEST HEADER TLS-Version: TLSv1.2

 Rule troubleshooting-pool <HTTP_REQUEST>: Redirecting to troubleshooting pool HTTP REQUEST HEADER TLS-Cipher: EXXXXX

 

Any help in troubleshooting will be appreciated. :)

 

5 Replies

No RepliesBe the first to reply