Forum Discussion
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
Jun 26, 2015Nimbostratus
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
}
}