Forum Discussion
Adrian_1807
Nimbostratus
Feb 17, 2010Data group with special characters
Hi,
I have an iRule using a string data group. The iRule look for those strings in the HTTP header to do the correct balancing
Now i need to add new strings to the data group, but those strings include special characters like carriage return ( \n ) or somethings like that.
The problem is that it seems not to recognize those characters for the comparison, and it doesn´t find those strings.
Do you know if there is any way to introduce those kind of characters in a data group???
Thank you very much in advance.
Best regards.
- hoolio
Cirrostratus
Hi Adrian, - Adrian_1807
Nimbostratus
Hi Aaron, - hoolio
Cirrostratus
Why couldn't they help with the question? You should be able to use / and ? and other meta-characters as string class elements. I just couldn't figure out how to include a newline or other character.b class chars_class list class chars_class { { "www.example.com/path/to/file.ext?param=value" } }
when RULE_INIT { log local0. "class search1: [class search chars_class contains "file.ext"]" log local0. "class search2: [class search chars_class contains "www.example.com/path/to/file.ext?param=value"]" log local0. "class search3: [class search -element chars_class contains "www.example.com/path/to/file.ext?param=value"]" }
- Hamish
Cirrocumulus
Add the data as a base64 encoded string. Then when you've readthe value from the class, simply decode it. - hoolio
Cirrostratus
Novel solution. You'd want to also base64 encode the string you're looking up against the class. - spark_86682Historic F5 AccountYou could also use URI encoding, as it would likely produce a smaller and more readable result if there are only a few characters that need to be encoded.
- Adrian_1807
Nimbostratus
Thank you very much for your answers. - Hamish
Cirrocumulus
Good catch. Data groups are also called classes. It just depends on where you're looking. e.g. The GUI calls them Data Groups. At the CLI they're classes. As they are in iRules (e.g. matchclass, findclass). You'll also find that rate shaping use rate classes... So don't confuse the two there... - hoolio
Cirrostratus
I think classes were renamed datagroups (around 9.2?) at least in the GUI to distinguish them from HTTP classes. It would be nice to change datagroups back as it just causes more confusion now when looking at the class definition in the bigip.conf or using the findclass/matchclass/class commands against a "datagroup".
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