26-Aug-2023 07:04
I have a question.
If for example I have 2 events in an iRule
when CLIENT_ACCEPTED {
if { [Condition]}{ do something}
}
}
when HTTP_REQUEST{
if { [Condition]}{ do something}
}
}
If both the conditions are met on both events, will the iRule process the traffic twice? once for the first event then one for the 2nd event?
Solved! Go to Solution.
26-Aug-2023 23:45
Nevermind, I've run this on my Lab. The answer is server 3 for all those who would look for the answers
26-Aug-2023 08:56
Hi @teemo_13 ,
If both events are triggered the traffic will be processed by both irules.
you can use priority in irules to specifiy which irule process traffic first , look at this link to know about priority ( https://clouddocs.f5.com/api/irules/priority.html)
you have to plan while writing irules , it consumes bigip resources.
26-Aug-2023 17:40
HI @Mohamed_Ahmed_Kansoh ,
If I would not use priority, would the "if" statement in the "when HTTP_REQUEST" block after the "if" statement in the "when CLIENT_ACCEPTED" has happened?
For example if I have a client 1.1.1.1 going to accessing server3.example.com:
when CLIENT_ACCEPTED {
if { [IP::addr [IP:: client_addr] equals 1.1.1.1 ] } { pool server1
}
if ( [IP::addr [IP:: client_addr] equals 1.1.1.2 ] } { pool server2
}
}
when HTTP_REQUEST {
if
}
HTTP::host equals "server3.example.com" } pool server3
if {HTTP::host equals "server4.example.com" }
pool server4
}
}
Will this go to server1 pool or the server3 prool?
26-Aug-2023 23:45
Nevermind, I've run this on my Lab. The answer is server 3 for all those who would look for the answers
27-Aug-2023 00:22
yes , That's correct
It will trigger the first event , then the second event
and take the last Action has been done.
to make sure of this also ( use log command in irule to show you a log message in ltm log after each action , this will make you know which event triggered also which condition has been met and which action has been performed )