DataGroup (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 ensure that date which is pulled from the datagroup is always lowercase regardless of what data is put into the datagroup. I am normalizing the data from the session variable as follows before I'm comparing the data from the datagroup. **How can I always make sure the data from the datagroup is lowercase (string and value)?
set strCountryCode [string toupper [ACCESS::session data get session.user.ipgeolocation.country_code]]
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 {$strCountryAuthorization eq "Blocked"} {
Kill Session
ACCESS::session remove
}
}