Forum Discussion
Vijay_Saxena_97
Nimbostratus
Nov 15, 2012Map of key/value pair in Irules
I want to create list of key and value pairs in Irules. In Java we can use the HashMap to acivie the goal. Not sure how can I do similar thing in Irules. I should be able to add remove the key value pairs. I need to search in that map with key.
6 Replies
- What_Lies_Bene1
Cirrostratus
You want to add or remove KVPs 'on the fly'? If not and it's just something you need to do every now and then, then a Data Group will do the trick. - Vijay_Saxena_97
Nimbostratus
Yes, I want to add/remove KVP 'on the fly'. With each HTTPRequest I need to check the kvp and update kvp and take appropriate action. Can I use the TCL Array to achive the goal? - What_Lies_Bene1
Cirrostratus
Hmmm, OK, Data Groups won't help here then. Perhaps the table command? https://devcentral.f5.com/wiki/iRules.table.ashx
I'm not sure if array's are available I'm afraid. - Vijay_Saxena_97
Nimbostratus
Thank you! Let me look into it. - Sec-Enabled_658
Cirrostratus
Im not sure what the overall goal is but would a making a sideband connection to a database with CSV data and populating it into a table used by the Irule work better? - hoolio
Cirrostratus
table entries can be used for dynamic key=value pairs. A data group would be good for statically defined pairs. And yes, you can use a sideband connection for supporting lookups from external sources.
https://devcentral.f5.com/wiki/iRules.table.ashx
https://devcentral.f5.com/wiki/iRules.class.ashx
https://devcentral.f5.com/wiki/iRules.sideband.ashx
Aaron
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