Forum Discussion

Chris_Phillips's avatar
Icon for Nimbostratus rankNimbostratus
Jan 13, 2012

using iRule name within rule




Is there any way to find the name of the irule being executed within the rule, as per [virtual name] for the virtual service? I want a simple way to pick up a data group with a specific name based on the name of the irule. I've tried using [virtual name] but it feels messy an unreliable depending on the way you assign rules etc.



This is the only thing I need to make a rule I'm working on totally generic and not need any customization at all between different copies of the same rule (which is how this place works...). Currently I have a "set static::prefix website_abc" etc, in the RULE_INIT. I know this is "trivial" to change, but it'd be really helpful if I can keep the contents of the rule byte for byte identical as it'd allow easier versioning change management etc.







2 Replies

  • Hi Chris,



    I don't think there is a native way to get the name of an iRule. But I remember seeing a request for enhancement for this. You could open a case with F5 Support to get your request added to the RFE.



  • I may well, although I've a feeling I'll decide life's too short after all!