I am using an iRule to move traffic to different pools based on data group strings. Initially for testing used the GUI data group interface to create the class file.
But for production, we will have a over a thousand web subdirectories to point at a Drupal pool; so I want to use the external data group file.
But having alot of problems figuring out the syntax on how to list strings.
Inside the GUI
/dev/
/it/
/tmpdev/
works just fine, but when created an external file under /var/class, it would not parse past the first line.
Here is the iRule I am using:
when HTTP_REQUEST
{ if { [matchclass [HTTP::uri] contains ${::Drupal}] } {
How are you seperating the external file entries? Are you using := or “;” or “,” etc. If you are then did you make sure you defined that in the datagroup you defined in the GUI?
Have you tried changing your code to the following
v9.x
when HTTP_REQUEST {
if { [matchclass [HTTP::uri] contains $Drupal} {
pool CCS_Drupal
} else {
pool CSS_Webnode
}
}
or
v10
when HTTP_REQUEST {
if { [class match [HTTP::uri] contains Drupal] } {
pool CCS_Drupal
} else {
pool CSS_Webnode
}
}
I am running version 10.1, I tried to following the BIGIP manual and having no real succes, a bit cryptic for me. F5 recommneds creating the external file in /var/class directory. using the bigpipe commands I was not even able to create the file, let alone create entries.
When I used the internal data group I used \“dev\” to separate. I see from the document should use ::= to separate arguments.
I am really looking for an example to follow, the ones in the manual are not very good and I have opened a support case with F5 this morning. but if you have an example, it would be great.
I’m curious how the BigIP handles modifications to the class files in a device sync or if you have to modify them manually in an Active/Standby pair.
Anything to help clean out the config files is worth the time in my opinion. Especially since we just automated our configuration files to be automatically exported, versioned and then put into a source control repository.
I agree with Steve. I think the class performance should be the same regardless of whether the class contents are loaded from the bigip.conf or an external class file. Make sure to use the name=value pairing and class commands though for lookups as this combination will be a lot more efficient than using “name value” format and the findclass or matchclass command.
Michael, the datagroup will be saved in a UCS file and synched during a config sync.
IIRC there’s a small perl program around here (i.e. on my laptop) somewhere that I wrote to populate an external classfile via iControl… I’ll see if I can find it tomorrow.
It detects whether the unit you’re targetting is active or standby. Only updates an active unit, and automatically performs a sync after the upload (It was written for v9.x so has to delete and re-populate the file… v10 can update on the fly, I should re-write it
Nice Hamish, I’ll have to re-post that if I can find it so folks can get their hands on it. Also keep in mind that the external class file format changed (for the better) in v10. So an updated version would definitely be worth it.