Forum Discussion
Hello Quasin,
- [virtual name] -> gives you the name of the current VS.
- virtual my_vs -> redirects the traffic to this VS (my_vs)
REF - https://clouddocs.f5.com/api/irules/virtual.html
thanks Dario_Garrido,
So that name will be populated automatically or I need to type in the name of "this VS i.e. current VS"?
Regards,
Qasim
- Jul 12, 2022
In link provided you have examples of usage. For example:
when HTTP_REQUEST { # If the current VS name is not "my_vs" if {[virtual name] ne "my_vs"} { # Then, redirect the traffic to a new VS called "my_vs" virtual my_vs } else { # If it is "my_vs", then just write a message in the log log local0. "endless loop avoided" } }
- QasimJul 12, 2022Cirrostratus
Hi Dario,
I created the IRULE but when assigning to a VS I am getting the following error:
: Unable to find virtual_server ((test_target_vs)) referenced at line 5: [virtual (test_target_vs)]
the test_target_vs definitely exists on LTM and here is my IRULE:
when HTTP_REQUEST {
if { [HTTP::uri] contains "/*" }
{
log local0. "internally routing from [virtual name] to (test_target_vs)"
virtual (test_target_vs)
}}- Jul 12, 2022
Avoid using "(" ")". Use this instead:
virtual test_target_vs
Btw, if the VS is located in a different partition than /Common, you need to reference that partition.
virtual /my_partition/my_vs