Forum Discussion
irule help to log a traffic to a VIP
Hello Subrun.
First you need to provision this iRule in the resources section of one specific virtual server.
After that, this iRule will be executed when the specific condition occurs, in your example (HTTP_REQUEST), when one HTTP resquest is received.
Beside this, take into account that "<action>" will only be executed when source IP ([IP::client_addr]) matches "10.10.10.10". You can modify it appropriately.
In your "action" section you can log anything (variables, text, etc.). An example:
when HTTP_REQUEST {
if {[IP::addr [IP::client_addr]] equals "10.10.10.10"} {
log local0. "Traffic matches the iRule"
}
}Another example:
when HTTP_REQUEST {
if {[IP::addr [IP::client_addr]] equals "10.10.10.10"} {
log local0. "Traffic matches the iRule with source IP: [IP::client_addr]"
}
}For logging traffic with responses, you should use HTTP_RESPONSE event.
Regards,
Dario.
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