Forum Discussion
Mike_Nepomny
Nimbostratus
Jan 09, 2013iRule access to Partition name
Hi,
I have few partitions created on LB v11. How to make iRule to read the name of its partition ?
Thank you.
4 Replies
- hoolio
Cirrostratus
Hi Mike,
You can use [URI::path [virtual name]] in any non-RULE_INIT event to get the iRule's path and [URI::basename [virtual name]] to get the virtual server name without the path. This was from Opher Shachar:
https://devcentral.f5.com/community/group/aft/2161361/asg/50
Aaron - Mike_Nepomny
Nimbostratus
Thank you Aaron.
What about RULE_INIT ? Is it possible to get partition name from RULE_INIT ?
- hoolio
Cirrostratus
The iRule isn't associated with a virtual server in RULE_INIT so you can't use [virtual name]. And I can't think of a way to get the full name of the iRule.
Aaron - THi
Nimbostratus
You could try:
[lindex [split [virtual name] /] 1]Split the full virtual server name into a list and then take the first element after initial null string:
[virtual name] /THi/THi_test
[lindex [split [virtual name] /] 1] THi
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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