Forum Discussion
Find current event name in irule subroutine.
I'm trying to write a subroutine that can log which event it was in when called. But I have not been able to find documentation as to which built-in variable would contain the current event name. If anyone can point me to a document that has this information or even just knows off the top of their head, I'd appreciate it.
I'm looking to do something like this:
proc log_debug args { log local0. "[IP::client_addr]; [virtual name]; [event name] -- $args" }
2 Replies
- Vijay_E
Cirrus
I am not aware of a specific variable that identifies the event. May be try looking under "event name" or "event info".
Assuming you don't have a lot of events, you can just explicitly use the name like HTTP_REQUEST within that event, if that satisfies your requirements.
- THi
Nimbostratus
If you need to log the event name, then put any logging statement to the iRule. The logger will insert the irule and the event names automatically into the log line, for example I'm logging the request uri with:
log local0. "http request : [HTTP::host][HTTP::uri]"Resulting log line in /var/log/ltm is:
Jan 2 08:47:00 labbigip.xxx.yyy info tmm[20170]: Rule /Testpartition/test_irule : http request : test.xxx.yyy/Haven't tested if it works similarly when having the logging statement within a proc. Worth trying, though.
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