Forum Discussion
Govind_32899
Jun 21, 2017Nimbostratus
for Send Email via iRule Procedures .
I used https://devcentral.f5.com/wiki/iRules.Send-Email-via-iRule-Procedures.ashx . But getting error Some fields below contain errors. Correct them before continuing. while applying irule to the VIP...
jomedusa
Altostratus
I am trying to do something similar and have created 2 irules, I can see log entries that the "event" is occuring, but I never see that the second irule is called. I am going to attempt to combine into a single one. Has anyone had success using the above?
cjunior
Jan 15, 2021Nacreous
Hello,
I'm not sure issues you are facing, so did you write the rule library name in front of procedure on the call statement?
e.g.
call procLibrary::sendEmail
Please, check if this short example makes more sense to you:
# Some virtual server
ltm virtual vs_devcentral {
destination 172.30.30.101:http
ip-protocol tcp
mask 255.255.255.255
profiles {
http { }
tcp { }
}
rules {
irule_devcentral
}
source 0.0.0.0/0
}
# iRule with events
ltm rule irule_devcentral {
when HTTP_REQUEST {
log local0. "This is from irule_devcentral"
call irule_lib_dc::externalProcedure()
}
}
# Library with procedures
ltm rule irule_lib_dc {
proc externalProcedure() {
log local0. "This is from externalProcedure() into irule_lib_dc"
HTTP::respond 200 content "<html><head></head><body>Voila!</body></html>" Connection close
}
}
The test:
[root@bigipdelta:Active:Standalone] tmp # curl -v http://172.30.30.101
* Rebuilt URL to: http://172.30.30.101/
* Trying 172.30.30.101...
* Connected to 172.30.30.101 (172.30.30.101) port 80 (#0)
> GET / HTTP/1.1
> Host: 172.30.30.101
> User-Agent: curl/7.47.1
> Accept: */*
>
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Server: BigIP
< Connection: close
< Content-Length: 45
<
* Closing connection 0
<html><head></head><body>Voila!</body></html>
Log:
[root@bigipdelta:Active:Standalone] tmp # tail /var/log/ltm
Jan 15 14:38:13 bigipdelta info tmm[11153]: Rule /Common/irule_devcentral <HTTP_REQUEST>: This is from irule_devcentral
Jan 15 14:38:13 bigipdelta info tmm[11153]: Rule /Common/irule_devcentral <HTTP_REQUEST>: This is from externalProcedure() into irule_lib_dc
Regards.
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