Forum Discussion
chungyu_16122
Mar 17, 2011Altostratus
Create an External class file
Hi all
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}] } {
pool CCS_Drupal
} else { pool CCS_Webnode }
}
- The_BhattmanNimbostratusHi chungyu,
when HTTP_REQUEST { if { [matchclass [HTTP::uri] contains $Drupal} { pool CCS_Drupal } else { pool CSS_Webnode } }
when HTTP_REQUEST { if { [class match [HTTP::uri] contains Drupal] } { pool CCS_Drupal } else { pool CSS_Webnode } }
- chungyu_16122AltostratusHi Bhattman
- Steve_Brown_882Historic F5 Account
- hooleylistCirrostratusSteve's example is a good one. The class wiki page also has examples of the datagroup formats:
- Michael_YatesNimbostratusDoes anyone know or has anyone noticed a performance hit for storing Data Groups in external class files?
- Steve_Brown_882Historic F5 AccountI am pretty sure the file is loaded into memory when the config is loaded. Unless I am wrong there shouldn't be.
- Michael_YatesNimbostratusI'll have to try this and run some tests.
- hooleylistCirrostratusI 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_YatesNimbostratusAwesome. Thanks hoolio!
- HamishCirrocumulusIIRC 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 :)
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