Forum Discussion
Datagroup into variable
Hi I am making an Irule and I need to set the value of a datagroup into a variable. Something like this
set url [RESOLV::lookup @8.8.8.8 domains]
I want that the varaible url gets the value of the dns result the datagroup domains.
Please help
I think this question answers what you need to do:
https://devcentral.f5.com/s/feed/0D51T00006i7ebKSAQ
he uses a foreach loop with the datagroup as the variables then you put your command set url, and whatever else after that.
- Lee_SutcliffeNacreous
In this example, you have a datagroup called 'domains' and a record, 'mydomain.com' which has a value of '10.1.1.1'
ltm data-group internal domains { records { mydomain.com { data 10.1.1.1 } } type string }
In an iRule, you can use the -value switch to return the value in a datagroup, rather than a Boolean match when using the class command
The following code will set a variable 'url' to '10.1.1.1'
set url [class match -value "mydomain.com" equals "domains"]
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