Forum Discussion
Jon_Strabala_46
Nimbostratus
Dec 15, 2009Only IRULE_INIT events are triggerred
Hello I am new to iRULES and using a system set up with two virtual servers, one is a "default_gateway" which was setup to rout all traffic to the internet. The other is a "irulestest" that is only triggered via a specific destination IP in a HTTP request.
A) I only get "log local0." messages from the RULE_INIT block, not from the CLIENT_ACCEPTED block
B) In the F5 management console under - I do get get traffic when I client makes requests
Overview : Statistics : Virtual Servers : iruletest
Overview : Statistics : Virtual Servers : default_gateway
C) Using the iRULES Editor (Statistics) I see that only IRULE_INIT for my iRULE called "production_irule" (shown below) has "executions" any other iRULE I create always has zero "Executions".
*) Of course this could be a configuration error in the base setup that I was provided (I am only trying to write an iRULE).
------------------------
My two virtual servers
------------------------
virtual default_gateway {
ip forward
destination any:any
mask none
rules production_irule
}
virtual iruletest {
pool google.com
destination 10.0.185.150:http
ip protocol tcp
rules test_irule_000
httpclass httpclass
profiles
http
tcp
}
------------------------
My two pools
------------------------
pool evdo_routers {
lb method member observed
monitor all gateway_icmp
members
10.255.252.2:any
10.255.252.3:any
}
pool google.com {
members
10.0.180.4:any
session disable
64.233.169.99:any
}
------------------------
My two iRULES
------------------------
rule production_irule {
when RULE_INIT {
this works -
logs to /var/log/ltm as it should
set ::g_prod_var 111
log local0. "production_rule initialized: $::g_prod_var"
}
when CLIENT_ACCEPTED {
this doesn't work - JAS/QSI
It should log to /var/log/ltm - perhaps nothing is
being routed/triggered to this virtual server
or somehow only RULE_INIT events are processed
log local0. "got a CLIENT_ACCEPTED production_rule"
}
}
rule test_irule_000 {
when RULE_INIT {
this works -
logs to /var/log/ltm as it should
set ::g_test_var 991
log local0. "test_irule_000 initialized: $::g_test_var"
}
when CLIENT_ACCEPTED {
log local0. "got a CLIENT_ACCEPTED test_irule_000"
}
when HTTP_REQUEST {
this doesn't work -
It should log to /var/log/ltm - perhaps nothing is
being routed/triggered to this virtual server
or somehow only RULE_INIT events are processed
log local0. "got a HTTP_REQUEST test_irule_000"
}
}
- hoolio
Cirrostratus
What destination hosts are you testing to? Can you add a log statement like this to each iRule in the CLIENT_ACCEPTED event and then post the (anonymized) logs from /var/log/ltm? - Jon_Strabala_46
Nimbostratus
That is the issue I have log statements in each iRULE - hoolio
Cirrostratus
I don't see anything that would prevent logging to /var/log/ltm in the syslog-ng.conf. If the log line to local0. contained AUDIT, it would go to /var/log/audit. But your log lines don't contain that string. - Jon_Strabala_46
Nimbostratus
I started my testing after - Jon_Strabala_46
Nimbostratus
Oddly enough when I enable a "Default Persistance Profile" to "cookie" for (Local Traffic / Virtual Servers / iruletest ) I actually get the colkie - hoolio
Cirrostratus
This is just plain odd. I'm running out of ideas. Do you have any other iRules added to the VIP which are disabling events? If not, I'd suggest opening a case with F5 Support. I'd be quite curious to hear about the outcome if you do end up opening a case. - Jon_Strabala_46
Nimbostratus
Aaron, by the LTM command line to you mean from a shell on the Linus system -or- do you mean from the "console" selection under "system" in the F5 web interface ? - hoolio
Cirrostratus
The GUI's console is limited to bigpipe commands. You would need SSH with advanaced shell (full command line) or serial console access to run curl from the command line.
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects