Forum Discussion
stucky101_88485
Aug 11, 2012Nimbostratus
Pull global variable from data group list
Gurus
I'm trying to do something that should be rather simple but I'm beginning to wonder whether I'm looking in the wrong place.
I have used 2 data group lists successfully of type string. Both of them simply contain a list of strings with no values and I iterate over them to compare some stuff to live traffic.
However, there is the option of also creating key:value pairs so I thought I could use this as a simple hash.
I created a class called "base" thinking I could add a few key:value pairs there that I can extract later.
Example :
domain := domain.company.com
Now I should be able to extract the value of key "domain" in an iRule and use it for example for redirects from short hostname to fqdn. It's basically like a global TCL var but aren't data group lists the way to go ?
It appears you have to run an operator against the key such as "equal" or "starts_with" when all I wanna do is look up its value and return it.
If this is not designed for that then what is the key:value option there for ?
Any help is appreciated
thx
- HamishCirrocumulusYou're using the [class ..] commands? Not matchclass and findclass right?
- stucky101_88485NimbostratusHamish
- hooleylistCirrostratusThat is a good way to set "global" variables in a data group. You could also use the static namespace if you want to avoid using a data group:
- stucky101_88485NimbostratusAaron
- hooleylistCirrostratus1. Yes, that's correct.
- stucky101_88485NimbostratusThank you Aaron !
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