Forum Discussion
CMR-NYC_176898
Nimbostratus
Oct 05, 2016DataGroup (string & value) tolower
I have some data [string] which I'm accessing in a Data Group from an iRule. Data example: EU = Blocked US = Blocked RU = Blocked I am using the following code to access the datagroup. I need to ...
Hamish
Cirrocumulus
Oct 05, 2016Apologies... I read this at least two ways...
Do you mean you want to return the value (strCountryAuthorization in your code) and then convert it to lower case?
Use
[string tolower $variable]
Returns string with all the letters converted from upper to lower case.This should do what you're asking for. Simply use the [string tolower $variable] TCL command to convert the string. e.g.
when ACCESS_POLICY_AGENT_EVENT {
if { [set strCountryAuthorization [class match -value $strCountryCode contains Blocked_Countries_dg]] ne "" } {
} else {
set strCountryAuthorization "allowed"
}
Terminate Session if Country is Blocked
if {[string tolower $strCountryAuthorization] eq "blocked"} {
Kill Session
ACCESS::session remove
}
}I'm not sure if you use strCountryAuthorization elsewhere if it's set to 'allowed'. If not, then that 'else' setting it to allowed is wasted CPU cycles.
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