Forum Discussion
Associate a Vserver with a property
Hi:
in my Irule I want to access a property that will be specific to the Vserver. this irule will be shared by multiple vservers but the property that I want to use will be specific to vserver. is there a way to set a property on vserver and I can read that in the Irule.
6 Replies
- Ronald_van_der_
Nimbostratus
I assume you are referring to variables. You might want to have a look here: https://devcentral.f5.com/articles/-the101-irules-101-variables
- sarat_82132
Nimbostratus
let me give my example There are two Vservers vserver-1 is for all sales applications and vserver-2 is for all marketing applications. there is one IRule ( code snippet below ) which needs to fetch different data groups. The way I solved this is by creating two Irule Instances f5 and assocate irule-1 to vserver-1 and irule-2 to vserver-2. all the contents are excatly same for irule-1 and irule-2 except the value of the dg_application_list_name ( example below) . if this value somehow can be read from the Vserver, that will be very useful. when HTTP_REQUEST priority 100 { set dg_application_list_name "sales-applications" set dg_application_list [class get $dg_application_list_name]}] foreach { row } $dg_application_list { do something } } when HTTP_REQUEST priority 100 { set dg_application_list_name "marketing-applications" set dg_application_list [class get $dg_application_list_name]}] foreach { row } $dg_application_list { do something } } - Ronald_van_der_
Nimbostratus
Ok, so if I understand correctly, you want to use a VS-configuration 'item' as the value. In other words, use a global iRule for multiple VS' and based on the VS (name e.g.) change the 'value'?
- Ronald_van_der3
Nimbostratus
I assume you are referring to variables. You might want to have a look here: https://devcentral.f5.com/articles/-the101-irules-101-variables
- sarat_82132
Nimbostratus
let me give my example There are two Vservers vserver-1 is for all sales applications and vserver-2 is for all marketing applications. there is one IRule ( code snippet below ) which needs to fetch different data groups. The way I solved this is by creating two Irule Instances f5 and assocate irule-1 to vserver-1 and irule-2 to vserver-2. all the contents are excatly same for irule-1 and irule-2 except the value of the dg_application_list_name ( example below) . if this value somehow can be read from the Vserver, that will be very useful. when HTTP_REQUEST priority 100 { set dg_application_list_name "sales-applications" set dg_application_list [class get $dg_application_list_name]}] foreach { row } $dg_application_list { do something } } when HTTP_REQUEST priority 100 { set dg_application_list_name "marketing-applications" set dg_application_list [class get $dg_application_list_name]}] foreach { row } $dg_application_list { do something } } - Ronald_van_der3
Nimbostratus
Ok, so if I understand correctly, you want to use a VS-configuration 'item' as the value. In other words, use a global iRule for multiple VS' and based on the VS (name e.g.) change the 'value'?
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