Forum Discussion

DDA_176163's avatar
DDA_176163
Icon for Nimbostratus rankNimbostratus
Aug 23, 2018

iRule able to ask what Virtual it's running on?

My question is: In iRules, is there a way for a running iRule to return the name or names of the VIP or Pool (name or ID)?

 

What sort of call would it be? Maybe a simple example?

 

We're trying an experiment with cookies to decide the pool selection. Rather than having a unique iRule per VIP (with the VIP name filled in), we'd like to have a generic one that we could simply use a query to figure out what VIP it's running on and match it to the cookie.

 

Any chance?

 

Thanks

 

D

 

2 Replies

  • Hello,

    you can do this simply (If in understand your need):

    when HTTP_RESPONSE {
    log local0. "VS Name: [virtual]"
    serverside {
        log local0. "pool member IP: [serverside {IP::remote_addr}]:[serverside {IP::remote_port}]"
    }
    
    }
    

    So using this irule you can retrieve Pool memeber that you reach an VS that you use for each request.

    If you give me more details about your need keep me in touch.

    Regards